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?
 A: Variation of Parameters
I will answer your question instead of you solving, and show you how I attempted the problem. I will begin as you did with undetermined coefficients: \begin{equation} y''-2y'+y=e^{2x} \end{equation} I will then solve for the homogenous portion of the problem: \begin{equation}y''-2y'+y=0 \end{equation}
Then I will write the auxiliary equation:
\begin{align}m^2-2m+1&=0\\(m-1)^2&=0 \end{align}
This then produces linearly independent terms, for the complementary solution of the problem: \begin{equation}y_c=c_1e^x+c_2xe^x \end{equation}
From here one can begin to set up the Wronskian for the known complementary solutions: \begin{equation} W=\begin{bmatrix}e^x&xe^x\\ e^x&xe^x+e^x \end{bmatrix}\end{equation}
Solving that we get the following: \begin{align}W&=e^x(xe^x+e^x)-e^x(xe^x)\\ W&=xe^{2x}+e^{2x}-xe^{2x}\\W&=e^{2x} \end{align}
Now we can set up the following two Wronskians: \begin{align}W_1&=\begin{bmatrix} e^x & 0 \\ e^x & e^{2x} \end{bmatrix}\\ W_1&=e^xe^{2x}-0e^x\\W_1&=e^{3x}\end{align} \begin{align}W_2&=\begin{bmatrix}0&xe^x\\e^{2x}& xe^x+e^x \end{bmatrix} \\ W_2&=0(xe^x+e^x)-e^{2x}(xe^x)\\ W_2=-xe^{3x} \end{align}
Now we can set up the following: \begin{align}y_1&=e^x\\y_2&=xe^x \end{align} \begin{align}u_1&=y_2\int \frac{W_1}{W}dx\\u_1&=xe^x(\int \frac{e^{3x}}{e^{2x}}dx)\\u_1&=xe^{2x} \end{align}\begin{align}u_2&=y_1\int \frac{W_2}{W}dx\\ u_2&=e^x \int -\frac{xe^{3x}}{e^{2x}}dx\\ u_2&=e^x \int-xe^xdx \\u_2&=e^x (-xe^x +e^x)=-xe^{2x}+e^{2x} \end{align}
Now we have the particular when we add up the two $u$'s.
\begin{equation}y_p=u_1+u_2=xe^{2x}-xe^{2x}+e^{2x}=e^{2x} \end{equation}
Now, we can add the complementary, and the particular and get the complete solution which is the following:\begin{equation}y=y_c+y_p=c_1e^x+c_2xe^x+e^{2x} \end{equation}
A: Laplace Transforms Method
This question can also solved using Laplace Transformation method. \begin{equation} y''-2y'+y=e^{2x} \end{equation} The method is simple to use if one does the following: \begin{align} y(0)&=c_1\\ y'(0)&=c_2\end{align} Now you can take the Laplace of both sides as well using these initial conditions: \begin{align}s^2Y(s)-sy(0)-y'(0)-2(sY(s)-y(0))+Y(s)&=\frac{1}{s-2}\\ (s^2-2s+1)Y(s)-sc_1-c_2-2c_1&=\frac{1}{s-2}\\ (s-1)^2Y(s)&=\frac{1}{(s-2)}+sc_1+2c_1+c_2 \\ Y(s)&=\frac{1}{(s-1)^2(s-2)}+\frac{sc_1}{(s-1)^2}+\frac{c_3}{(s-1)^2} \end{align} Now comes the task of using partial fraction decomposition to ease the problem as before we take the inverse Laplace. \begin{align*} \frac{A}{(s-1)}+\frac{B}{(s-1)^2}+\frac{C}{(s-2)}&=\frac{1}{(s-1)^2(s-2)}\\ A(s-2)(s-1)+B(s-2)+C(s-1)^2 &=1\\C&=1\\A(s^2-3s+2)+Bs-B2+s^2-2s+1&=1\\As^2-3As+2A&\\0+Bs-B2&\\s^2-2s+1 \end{align*}
Now we can create systems of linear equations, and using row echelon or elimination we can solve those systems:\begin{align} A+1&=0\\ A&=-1 \\3+B-2&=0 \\-2-2B+1&=1\\B&=-1 \end{align} This leaves us with the following: \begin{equation}Y(s)=\frac{1}{s-2}-\frac{1}{s-1}-\frac{1}{(s-1)^2}+\frac{sc_1}{(s-1)^2}+\frac{c_3}{(s-1)^2} \end{equation}
Now when we take the inverse laplace we get the following: \begin{equation}y=e^{2x}-e^x-xe^x+c_1(xe^x+e^x)+c_2xe^x \end{equation} Now with the auto correcting c and combing like terms everything combines into the same solution: \begin{equation}y=c_1e^x+c_2xe^x+e^{2x} \end{equation}
A: Annihilator Method
Last Method that I know as far as my two-year college got me up to.\begin{equation} y''-2y'+y=e^{2x} \end{equation} First part would be to use the auxiliary equation to solve for the homogeneous portion of the differential equation: \begin{align} m^2-2m+1&=0 \\ (m-1)^2&=0 \\ m&=1 \end{align} From here we can see that we two solutions that are linearly independent solutions for the homogeneous portion: \begin{equation} y_h=c_1e^x+c_2xe^x \end{equation} Once we have that we can apply the annihilator approach, our differential operator will be the following $(D-2)$. Therefore we can rewrite the equation as the following: \begin{equation} (D-2)(D^2-2D+1)=(D-2)(e^{2x}) \end{equation} This reduces our equation to the following: \begin{equation}(D-2)(D-1)^2=0 \end{equation} From here we can see that we have solutions which we are the previous solutions. \begin{equation} y=\bbox[border:2px solid yellow]{c_1e^x+c_2xe^x}+c_3e^{2x} \end{equation} Now we know our particular so; therefore, one can know what to substitute. \begin{equation} y=Ae^{2x}\end{equation} \begin{align}y''-2y+y&=e^{2x} \\ 4Ae^{2x}-4Ae^{2x}+Ae^{2x}&=e^{2x}\\ A&=1 \end{align} Thus now we have the final solution: \begin{equation}y=c_1e^x+c_2xe^x+e^{2x} \end{equation}
