1. linear differential equation

Hello

im stuck on the following differential equation. I understand since it linear we find the general solution by finding the complementary function and adding it together with a particular integral. Im stuck because in this example the RHS has both a linear function and an exponential and im unsure of how to go about doing the trail function subsitution.

Find a solution to the following differential equation

$\displaystyle dy/dx + 4y = 4x + e^x$

with $\displaystyle y(0)=0$

iv gotten as far as the CF = $\displaystyle Ae^-4x$
any help most appreciated

2. Hello, jordanrs!

Find a solution to the following differential equation:
. . $\displaystyle \frac{dy}{dx} + 4y \:=\: 4x + e^x\;\;\text{ with }y(0)=0$
You already found the homogeneous solution: .$\displaystyle y \:=\:ke^{-4x}$

We can conjecture that the particular solution has the form:
. . $\displaystyle y \;=\;Ax + B + Ce^x$

. . $\displaystyle \begin{array}{ccccc}\text{Then: }& \dfrac{dy}{dx} &=& A + Ce^x \\ \\[-4mm] \text{and:} & 4y &=& 4Ax + 4B + 4Ce^x \end{array}$

Add the equations: .$\displaystyle \frac{dy}{dx} + 4y \;=\;4Ax + (A+4B) + 5Ce^x$

This is supposed to equal $\displaystyle 4x + e^x$

. . So we have: .$\displaystyle 4Ax + (A+4B) + 5Ce^x \;=\;4x+ 0+ 1\!\cdot\!e^x$

Equate the coefficients: .$\displaystyle \begin{Bmatrix}4A &=& 4 \\ A+4B &=& 0 \\ 5C &=& 1 \end{Bmatrix}$

. . and we get: .$\displaystyle A = 1,\;B = \text{-}\tfrac{1}{4},\;C = \tfrac{1}{5}$

Hence, the particular solution is: .$\displaystyle y \;=\;x - \tfrac{1}{4} + \tfrac{1}{5}e^x$

So far, the solution is: .$\displaystyle y \;=\;ke^{-4x} + x - \tfrac{1}{4} + \tfrac{1}{5}e^x$

Since $\displaystyle y(0) = 0$, we have: .$\displaystyle ke^0 + 0 - \tfrac{1}{4} + \tfrac{1}{5}e^0 \;=\;0 \quad\Rightarrow\quad k - \tfrac{1}{4} + \tfrac{1}{5} \:=\:0 \quad\Rightarrow\quad k \:=\:\tfrac{1}{20}$

Therefore, the solution is: .$\displaystyle \boxed{y \;=\;\frac{1}{20}e^{-4x} + x - \frac{1}{4} + \frac{1}{5}e^x}$

3. yep that makes alot of sense using the 2 combined trial solutions in one and then differentiating and solveing through

really appreciate the help

thanks alot