# Solving the DE using undetermined coefficients.

#### sakonpure6

Hello, I have the DE: $$\displaystyle y'' + 2y'+y=2x \cdot sin(x)$$ and I proceed to solve using the method of undetermined coefficients and some work I got the following equation and I am not sure how to solve for the coefficients:

$$\displaystyle [ \, \alpha \, (2mx+2b+1) \, + \, 2\beta \,] \, cos(x) + [\, \beta \, (-2mx-b-1) \,+ \,2\alpha \,] \, sin(x)=2x \cdot sin(x)$$

where $$\displaystyle \alpha \, , \beta \, , m \, ,b \,$$ are real coefficients.

The solution manual solved this problem using variation of parameters.

-Sakon

Last edited:

#### Archie

What is your trial solution? What are $\alpha$, $\beta$, $m$ and $b$.

Last edited:

#### johnsomeone

You need to go from here: $$\displaystyle [ \alpha (2mx+2b+1) +2\beta]cosx + [\beta (-2mx-b-1)+2\alpha]sinx=2xsinx$$

to here: $$\displaystyle [ \alpha (2mx+2b+1) +2\beta] \cos(x) + [\beta (-2mx-b-1)+2\alpha - 2x] \sin(x)=0$$, so

$$\displaystyle [ \left( 2 m \alpha \right) x + \left( (2b+1)\alpha + 2\beta\right) ] \cos(x) + [ \left( -2m \beta -2 \right) x + \left( -(b+1) \beta + 2 \alpha \right) ] \sin(x)$$ $$\displaystyle = 0$$,

so, to hold for every x, (and knowing that tangent isn't just a rational function), need this:

$$\displaystyle \left( 2 m \alpha \right) x + \left( (2b+1)\alpha + 2\beta\right) = 0$$, and $$\displaystyle \left( -2m \beta -2 \right) x + \left( -(b+1) \beta + 2 \alpha \right) = 0$$ for all x.

But that becomes:

$$\displaystyle 2 m \alpha = 0, (2b+1)\alpha + 2\beta = 0, -2m \beta -2 = 0, and -(b+1) \beta + 2 \alpha= 0$$.

There are no constants which make that work. So you made a mistake somewhere - that, or this approach cannot work. Since you didn't show any work, I don't know exactly what you did.

Last edited:

#### sakonpure6

I let $$\displaystyle y_p(x)= (\right (\, mx+b \, \left ) \, \right ( \, \alpha \, sin(x) \, + \, \beta \, cos(x) \, \left)$$

#### Archie

Your problem is that your coefficients don't have enough freedom. If you have no $x \sin x$ terms in $y$, you either have no $x \cos x$ terms or you have no $\sin x$ terms.

Try $y_p = x(a \cos x + b \sin x) + (c \cos x + d \sin x)$ when all the coefficients are completely independent.