# For the nonhomogeneous equation, using the method of undetermined coefficients, the solution I got for (d^2y)/(dx^2) - 5(dy)/(dx) + 6y = xe^x is y = (xe^x)/2 + (3e^x)/4, but along the way I got two solutions for A_1?

## NOTE: As usual, I figured it out a few minutes after I posted this. Oh well! Leaving it up for other people to see, then. :) I was letting $y = x \left({A}_{1} x + {A}_{0}\right) {e}^{x}$, and I got $\frac{\mathrm{dy}}{\mathrm{dx}} = \left[{A}_{1} {x}^{2} + \left(2 {A}_{1} + {A}_{0}\right) x + {A}_{0}\right] {e}^{x}$ and $\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} = \left[{A}_{1} {x}^{2} + \left(4 {A}_{1} + {A}_{0}\right) x + 2 {A}_{1} + 2 {A}_{0}\right] {e}^{x}$. When I solved for ${A}_{0}$ and ${A}_{1}$ however, I got: ${x}^{2}$ terms: ${A}_{1} - 5 {A}_{1} + 6 {A}_{1} = 0 \implies {A}_{1} = 0$ is one solution to the quadratic (whoops, just realized this) $x$ terms: $4 {A}_{1} + {A}_{0} - 10 {A}_{1} - 5 {A}_{0} + 6 {A}_{0} = 1$, and if ${A}_{1} = 0$, then: ${A}_{0} = \frac{1}{2}$ Constant terms: $2 {A}_{1} + 2 {A}_{0} - 5 {A}_{0} = 0$, and if ${A}_{1} \ne 0$, then ${A}_{1} = \frac{3}{2} {A}_{0} = \frac{3}{4}$. So the result is indeed $y = \frac{x {e}^{x}}{2} + \frac{3 {e}^{x}}{4}$.

Jan 8, 2017

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} - 5 \frac{\mathrm{dy}}{\mathrm{dx}} + 6 y = x {e}^{x}$ is a linear non-homogeneous differential equation.

The solution ${y}_{p} = \frac{x {e}^{x}}{2} + \frac{3 {e}^{x}}{4}$ is a particular solution for the differential equation.

The complete solution can be composed as the addition of a particular solution plus the homogeneous solution. The homogeneous solution has the structure

${y}_{h} = {C}_{1} {e}^{2 x} + {C}_{2} {e}^{3 x}$

as can be easily verified, so the complete solution is

$y = {y}_{h} + {y}_{p} = {C}_{1} {e}^{2 x} + {C}_{2} {e}^{3 x} + \frac{x {e}^{x}}{2} + \frac{3 {e}^{x}}{4}$ without ambiguity in the ${C}_{1} , {C}_{2}$ determination.

Jan 8, 2017

I'll use $A = {A}_{0}$ and $B = {A}_{1}$ to save typing

The problem is you are trying the wrong solution you have
$g \left(x\right) = \left(a {x}^{2} + b\right) {e}^{x}$ and you should be trying $g \left(x\right) = \left(a x + b\right) {e}^{x}$

So for the PI we have:

$y = \left(A x + B\right) {e}^{x}$

$y ' = \left(A x + B\right) \left({e}^{x}\right) + \left(A\right) \left({e}^{x}\right)$
$\setminus \setminus \setminus \setminus = \left(A x + B\right) {e}^{x} + A {e}^{x}$

$y ' ' = \left(A x + B\right) {e}^{x} + A {e}^{x} + A {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus = \left(A x + B\right) {e}^{x} + 2 A {e}^{x}$

Subs into the DE and we get:

$y ' ' - 5 y ' + 6 y = x {e}^{x}$

$\therefore \left\{\left(A x + B\right) {e}^{x} + 2 A {e}^{x}\right\} - 5 \left\{\left(A x + B\right) {e}^{x} + A {e}^{x}\right\} + 6 \left\{\left(A x + B\right) {e}^{x}\right\} = x {e}^{x}$

Compare coefficients of $x {e}^{x}$:

$A - 5 A + 6 A = 1 \implies 2 A = 1 \implies A = \frac{1}{2}$

Compare coefficients of ${e}^{x}$:

$B + 2 A - 5 B - 5 A + 6 B = 0$
$2 B - 3 A = 0 \implies 2 B - \frac{3}{2} = 0 \implies B = + \frac{3}{4}$

So the PI should be:

$y = \left(\frac{1}{2} x + \frac{3}{4}\right) {e}^{x}$