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}$
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$.