# Solving $y' -3y = x \cdot e^x$

I'm struggling with this differential equation: $y' -3y = x \cdot e^x$
Step one: Solve the homogenous equation $y' -3y = 0$ $$y_0 = e^{3x} \cdot C$$

The approach for the particular solution $y_p$ should be $(c_1x+c_0)\cdot Ce^x$

This leads me to the following term: $$y_p = Ce^x(ax+b)$$ $$y'_p= Ce^x\cdot(ax+b)+Ce^x\cdot a$$ $$Ce^x\cdot(ax+b)+Ce^x\cdot a - 3Ce^x(ax+b) = x\cdot e^x$$ $$C\cdot(ax+b)+C\cdot a - 3C(ax+b) = x$$

The C is a real problem here. After taking a look in my textbook I saw that the approach for $y_p$ is: $$y_p = (ax + b)\cdot e^x$$ $$y'_p = e^x \cdot (ax +b)+e^x \cdot a$$ Plugging this into $y' - 3y = x\cdot e^x$ and simplify gives:
$$x(-2a)+a-2b=x \Rightarrow a=-\frac{1}{2}; b=-\frac{1}{4}$$ And finally $$y= e^{3x}\cdot C - \frac{1}{4}(e^x+2xe^x)$$

When I omit the C I'm able to solve this but I don't know why this is correct as the approach for $g(x)$ would be $C\cdot e^{bx}$

• The particular solution is supposed to be any solution to the whole equation. $C$ is extraneous as you can absorb it into $a$ and $b$. You can see that by looking at your solution where it always multiplies one or the other. If you are going to use $C$ you should use a different variable than the one you used for the general solution. That is a good way to get confused. – Ross Millikan Sep 19 '18 at 0:16

Just note that as $c_0 , c_1 , C$ vary all over $\mathbb{R}$ you have that $a=c_1C$ and $b=c_0C$ vary all over $\mathbb{R}$ AND $(c_1x+c_0)Ce^x = (ax+b)e^x$.
So considering $3$ variables is useless (they are too many) since you only want a constant for $xe^x$ and a constant for $e^x$.
$$C\cdot(ax+b)+C\cdot a - 3C(ax+b) = x$$ $$-2Cax+(Ca-2Cb)=x$$ $$\implies aC=-1/2,$$ $$\implies 2Cb=Ca \implies Cb=-1/4$$ $$y_p = Ce^x(ax+b) \implies y_p = e^x(-\frac12x-\frac 14)$$ $$y_p = -\frac 12e^x(x+\frac 12)$$