since the homogeneous solution also has the same form as the nonhomogeneous part I was a bit confused on how to guess the form of the particular solution. any help is greatly appreciated. My guess is the following $$Y_P =C \sin(kx) +D \cos(kx)$$ but I think the correct guess would be $Y_P=(C+Dx)(A\sin(kx) + B\cos(kx))$ where the $A\sin(kx)+B\cos(kx)$ is our homogeneous solution.
2 Answers
As you mentioned the homogeneous solution is
$${y_h} = A\cos (kx) + B\sin (kx)\tag{1}$$
and hence your particular solution $y_p$ surely cannot be like $(1)$ as it just make the LHS of the ODE being zero, leaving you with nothing! :)
So we may try particular solutions of the form
$${y_p} = Cx\sin (kx) + Dx\cos (kx)\tag{2}$$
Put it into the ODE to obtain
$$\begin{array}{l} C\left[ {(2k\cos (kx) - {k^2}x\sin (kx) + {k^2}x\sin (kx)} \right] + \\ D\left[ {( - 2k\sin (kx) - {k^2}x\cos (kx) + {k^2}x\cos (kx)} \right]\\ = 2Ck\cos (kx) - 2Dk\sin (kx) = \sin (kx) \end{array}\tag{3}$$
and hence
$$\left\{ \begin{array}{l} C = 0\\ D = - \frac{1}{2k} \end{array} \right.\tag{4}$$
and finally your particular solution is
$${y_P} = - \frac{1}{2k}x\cos (kx)\tag{5}$$
and your general solution will be
$$y = {y_h} + {y_p} = A\cos (kx) + B\sin (kx) - \frac{1}{2k}x\cos (kx)\tag{6}$$
- 14,882
-
Welcome to MSE and enjoy the community! :) There is a check mark next to each answer. You can use it to choose the best answer in your own opinion! :) – Hosein Rahnama Oct 25 '15 at 17:17
-
@MSB: Please choose one of the answers above by check marking it! :) – Hosein Rahnama Oct 25 '15 at 17:20
Your first guess is the general solution of the homogeneous equation. The correct guess is what you believe to be correct, where you can take $C=0$ and $D=1$.
- 76,354
-
I think you have made a mistake in choosing proper constants! :) Would you please take a look at this question of mine which is related to PDEs. :) – Hosein Rahnama Oct 25 '15 at 17:23
-
-
Again, If you see my answer that choice of constants will not do the job! :) – Hosein Rahnama Oct 25 '15 at 17:28
-
Wel, I do not see any difference between my choice of constants and yours in the answer to the present question. What you call $C,D$ I call $A,B$, like in the OP question. – Julián Aguirre Oct 25 '15 at 17:34
-
I mean that there must be some $k$ involved! :) Look at (5) in my answer. Did you look at my question about PDE Prof? :) – Hosein Rahnama Oct 25 '15 at 17:38
-
I did not give the full solution. I just gave a guess for the solution. I left the OP to find the concrete values of the constants. – Julián Aguirre Oct 25 '15 at 17:40
-