Variation of parameters with a common function in yc and yp I have this problem to solve.  $(D^2-1)y=1+e^x$.
I got a solution of $c_1.e^x+c_2.e^{-x}$  so $y_p=A.x.e^x+B.e^{-x}$.    I want to solve this by using the definitions of $A'y_1 + B'y_2 =0$ and $A'y'_1+ B'y'_2=1+e^x$.  I end up with two equations.  $A'xe^x + B'e^{-x}=1+e^x$ .  So i solve this system of equations and I found that $A=-e^{-x}-1/2.e^{-2x}$.  now I am not sure what to do next, or if I am wrong.
 A: We are given:
$$y'' - y = 1 + e^x$$
If I understand, you want to use equations $(5)$ and $(6)$ from the derivation of Variation of Parameters as shown on that site to find the functions $u_1$ and $u_2$.
If we solve the homogeneous equation, we get:
$$y_h(x) = c_1 e^x + c_2 e^{-x}$$
We have $y_1(x) = e^x, y_2(x) = e^{-x}, g(x) = 1 + e^x$. From equations $(5)$ and $(6)$, we have:
$$u_1'y_1 + u_2' y_2 = 0 \\ u_1'y_1' + u_2' y_2' = g(x)$$
Setting this up, we have:
$$u_1' e^x + u_2' e^{-x} = 0 \\ u_1' e^x - u_2' e^{-x} = 1 + e^x$$
Subtracting the first equation from the second (you could have just as easily added them together and solved for $u_1$):
$$-2 u_2' e^{-x} = 1 + e^x \implies u_2' = -\dfrac{1}{2}(e^x + e^{2 x})$$
Integrating both sides:
$$u_2 = -\dfrac{1}{2}\left(e^x + \dfrac{1}{2} e^{2x}\right)$$
Now substitute that into the first equation and find $u_1$. You should get $u_1 = \dfrac{1}{2}(x - e^{-x})$.
Recall, that we will end up with:
$$y(x) = y_h(x) + y_p(x) = c_1 e^x + c_2 e^{-x} + u_1 y_1 + u_2 y_2 = c_1 e^x + c_2 e^{-x} + \dfrac{1}{4} \left(-4 - e^x + 2 x e^x \right)$$
You can of course write that as:
$$y(x) = c_1 e^x + c_2 e^{-x} + \dfrac{1}{2} x e^x -1$$
After that, use Variation of Parameters and convince yourself that you get exactly the same result. You are correct that the Wronskian of $y_1$ and $y_2$ is $2$.
A: If you like some integration stuff more than solving equations then an equivalent method is as follows:
For $y''(x)+P(x)y'(x)+Q(x)y(x)=R(x)$, let $y_1(x)$ and $y_2(x)$ be the homogeneous solutions corresponding to $y''(x)+P(x)y'(x)+Q(x)y(x)=0$.
Then $y=u(x).y_1(x)+v(x).y_2(x)$ is the complete solution, where
$u(x)=\int\frac{-R(x).y_1(x)}{W(x)}dx+A$ and  $v(x)=\int\frac{R(x).y_2(x)}{W(x)}dx+B$ with Wronskian $W(x)=y_1(x).y'_2(x)-y'_1(x).y_2(x)$.
In your case $y=u(x).e^x+v(x).e^{-x}$ must the complete solution and $W(x)=-2$. 
