My solution to inhomogeneous $\frac{d^2y}{dx^2} + y = \sin{x}$ does not conform to my book's solution!

100 Views Asked by At

I need help with the solution of this particular equation:

$$\frac{d^2y}{dx^2} + y = \sin{x}$$

Due to me having to go to work, I cannot display all my work in mathjax, my shift starts in 5 min...but my solution is: $$y= \frac{-x}{2} + \frac{(\cos{2x}\sin{x})}{4} + C_1\cos{x} + C_2\sin{x}$$

Whereas my book's solution is: $$y= \frac{-x}{2} +C_1\cos{x} + C_2\sin{x}$$

I have used the method of variation of prameters, cramer's rule and basic antidifferentiation to solve resulting system.

Thank you all!

3

There are 3 best solutions below

0
On

With characteristic equation $\lambda^2+1=0$ we know that the general solution is of the form $y_g=C_1\sin x+C_2\cos x$. Since the right side of the equation is $\sin$, one of the general answer, then the particular solution is of the the form $y_p=Ax\sin x+Bx\cos x$, after substitution we have $A=0$ and $B=-\dfrac12$, therefore solution is $$y_g=C_1\sin x+C_2\cos x-\dfrac12x\cos x$$

0
On

$$y'' + y = \sin{x}$$ $$y''\cos(x) + y\cos(x) = \frac 12 \sin{(2x)}$$ $$y''\cos(x) -y'\sin(x)+y'\sin(x)+ y\cos(x) = \frac 12 \sin{(2x)}$$ $$(y'\cos(x))'+(y\sin(x))'= \frac 12 \sin{(2x)}$$ First integration $$(y'\cos(x))+(y\sin(x))= -\frac 14 \cos{(2x)}+K_1$$ $$(\frac y {\cos(x)})'= -\frac 14 \frac {\cos{(2x)}+K_1}{\cos^2(x)}$$ Second integration $$(\frac y {\cos(x)})= -\frac 14 \int \frac {\cos{(2x)}+K_1}{\cos^2(x)}dx+K_2$$ $$(\frac y {\cos(x)})= -\frac 14 \int \frac {2\cos^2(x)+K_1}{\cos^2(x)}dx+K_2$$ $$ y = -\frac 12x\cos(x)+ K_1\cos(x)\int \frac {dx}{\cos^2(x)}+K_2\cos(x)$$ Finally $$ \boxed{y = -\frac 12x\cos(x)+ K_1\sin(x)+K_2\cos(x)}$$

3
On

Since you mention variation of parameters, I'll summarize the method here. Hopefully you can retrace your steps to find the mistake.

From the fundamental solution

$$ y_h(x) = c_1\cos x + c_2\sin x $$

we then seek a particular solution of the form

$$ y_p(x) = u_1(x)\cos x + u_2(x)\sin x $$

Plugging in the solution and following the method, we arrive at the system of equations:

\begin{align} {u_1}'\cos x + {u_2}'\sin x &= 0 \\ -{u_1}'\sin x + {u_2}'\cos x &= \sin x \end{align}

Using Kramer's rule, we find

\begin{align} {u_1}' &= -\sin^2 x = \frac{-1+\cos 2x}{2} \\ {u_2}' &= \cos x\sin x = \frac{\sin 2x}{2} \end{align}

Integrating gives

\begin{align} y_p(x) &= \left(-\frac{x}{2} + \frac{\sin 2x}{4} \right)\cos x - \frac{\cos 2x}{4}\sin x \\ &= -\frac{x}{2}\cos x + \frac{\sin 2x\cos x-\cos 2x\sin 2x}{4} \\ &= -\frac{x}{2}\cos x +\frac{\sin x}{4} \end{align}

We can disregard the second term, since it'll combine with the fundamental solution. Thus, the general solution is

$$ y(x) = -\frac{x}{2}\cos x + c_1\cos x + c_2\sin x $$