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

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

with $y(0)=0$

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

2. Hello, jordanrs!

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

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

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

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

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

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

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

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

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

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

Since $y(0) = 0$, we have: . $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: . $\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