Variation of parameters exercise 1

Exercise:

$$y’-3y=x\cdot e^{4x}$$



Solution:

At first we need to solve the homogeneous equation, for example by separation of variables or by hard thinking:

$$y’-3y=0 \\ y_0 = K\cdot e^{3x}\quad K\in\mathbb{R}$$

To solve the non-homogeneous equation, we transform the constant K in a function of x:

$$y = K(x)\cdot e^{3x}$$

We derive this y:

$$y’= K'(x)\cdot e^{3x} + 3~K(x)\cdot e^{3x}$$

Those y and y’ are plugged into the original non-homogeneous differential equation, which can be rearranged:

$$\begin{align*}y’-3y &=x\cdot e^{4x}\\ \Leftrightarrow K'(x)\cdot e^{3x} + 3~K(x)\cdot e^{3x}~-3~ K(x)\cdot e^{3x} &=x\cdot e^{4x}\\ \Leftrightarrow K'(x)\cdot e^{3x} &=x\cdot e^{4x}\\ \Leftrightarrow K'(x) &=x\cdot e^{x}\end{align*}$$

Now we can find K(x) by a (more or less) simple integration:

$$\begin{align*}K(x) &= \int K'(x)~dx\\ &= \int x\cdot e^{x}~dx\\ &= (x-1)\cdot e^x +C \quad C\in \mathbb{R}\end{align*}$$

To get the general solution of the non-homogeneous differential equation, we substitute the K(x) with the above.

$$\begin{align*}y &= K(x)\cdot e^{3x} \\ &= ((x-1)\cdot e^x +C)\cdot e^{3x} \\ &= (x-1)\cdot e^{4x}~+~C\cdot e^{3x}\end{align*}$$