# Solving differential equation using variation in parameters method.

I'm a bit stuck on this problem and could use some help.

I'm trying to solve this differential equation using two methods: variation of parameters and undetermined coefficients. They should be equal. I'll start with the undetermined coefficients first:

$$y'' - 2y' + y = e^{2x}$$ auxiliary equation: $$r^2 - 2r + 1 = 0$$ $$(r-1)(r-1)$$ so the root is 1 so the complimentary equation is:$$y_c = c_1e^x + c_2xe^x$$

So, a guess $$y_p = Ae^{2x}$$ so $$y_p' = 2Ae^{2x}$$ and so $$y_p'' = 4Ae^{2x}$$

and so plugging:

$$4Ae^{2x} - 4Ae^{2x} + Ae^{2x} = e^{2x}$$ and so A = 1 so $$y_p = e^{2x}$$

so teh general solution via undetermined coefficients is: $$y = c_1e^x + c_2xe^x + e^{2x}$$

Now for variation in parameters which should be the same:

so we have the complimentary equation: $$y_c = c_1e^x + c_2xe^x$$

and so we replace the constants with functions and look for a particular in this form: $$y_p = u_1(x)e^x + u_2(x)xe^x$$

differentiating:

$$y_p' = u_1e^x + u_1'e^x + u_2(xe^x + e^x) + u_2'xe^x$$

then set $$u_1'e^x + u_2'xe^x = 0$$ $$y_p' = u_1e^x + u_2xe^x + u_2e^x$$

so

$$y_p'' = u_1e^x + u_1'e^x + u_2(xe^x + e^x) + u_2e^x + u_2'e^x$$

so subbing:

$$u_1e^x + u_1'e^x + u_2xe^x + u_2e^x) + u_2e^x + u_2'e^x - 2u_1e^x - 2u_2xe^x + 2u_2e^x + u_1e^x + u_2xe^x = e^{2x}$$

I am having trouble solving:

so my two equations are:

$$u_1'e^x + u_2'e^x = e^{2x}$$

$$u_1'e^x + u_2'xe^x = 0 \rightarrow u_1'e^x = -u_2'xe^x \rightarrow u_1' = -u_2'x$$

so can I then sub in $$u_1'$$ like this: $$-u_2'xe^x + u_2'e^x = e^{2x}$$ Is this right so far? how do I go from here?

• You have made an error in finding $y_p''$ in variation of parameters.$$y_p'' = u_1e^x + u_1'e^x + u_2(xe^x + e^x)+\color{blue}{u_2'xe^x} + u_2e^x + u_2'e^x= u_1e^x + u_2(xe^x + e^x)+ u_2e^x + u_2'e^x$$ – Shubham Johri May 6 at 17:18
• fml.... okay let me try this again – Jwan622 May 6 at 17:21