# Trial function for ODE (Exam tomorrow)

1. Nov 8, 2005

### jdstokes

$y''-3y'+2y=\mathrm{e}^x +1$

Find $y$.

Going through the normal procedure we get the complementary function

$y = A\mathrm{e}^x + B\mathrm{e}^{2x}$.

Using the trial function

$y = Cx\mathrm{e}^x + D$
(because of overlap with the complementary function)

$-C\mathrm{e}^x + 2D = \mathrm{e}^x+1$

Does this mean

$C=-1,D=1/2$??

If so, the general soln is $y = A\mathrm{e}^x + B\mathrm{e}^{2x} -x\mathrm{e}^x + 1/2$.

According to Mathematica, however, the solution should be of the form

$y = A\mathrm{e}^x + B\mathrm{e}^{2x} + 1/2(1-2\mathrm{e}^x -2\mathrm{e}^xx)$.

Am I using the wrong trial function or what?