Solve the initial-value problem.

y'' - 2y' + y = 0 , y(2) = 0 , y'(2) = 1
r^2-2r+1=0, r1=r2=1
y(x)=c1*e^x+c2*x*e^x
y(2)=c1*e^2+c2*2*e^2=0
c1=-(2*c2*exp(2))/exp(2)
c1=-2*c2
y'(x)=-2*c2*e^x+c2*e^x*(x-1)
y'(2)=-2*c2*e^2+c2*e^2*(2-1)=1
c2(-2e^2+e^2)=1
c2=1/(-2e^2+e^2)=1/(-e^2)
c1=-2/(-e^2)=2/(e^2)
y(x)=(2/e^2)(e^x)-(1/e^2)xe^x
y(x)=(2e^x-xe^x)/e^2

What is wrong with this answer? Did I miss or mess up a step? Thanks.

Where did you get the (x-1) in y'?

Well I don't know how I got the (x-1) but I corrected it and I get the following answer,

y(x) = (2/e^2)*e^x - (1/e^2)*x*e^x

which is still incorrect. Any thoughts???

Nevermind I got it...thanks.

It seems that there was a slight mistake in your calculation. The correct expression for y'(x) is:

y'(x) = -2*c2*e^x + c2*e^x*(x-2)

When you substituted x=2 into this expression, you incorrectly obtained -2*c2*e^2 + c2*e^2*(2-1) = 1. Let's redo this calculation correctly:

y'(2) = -2*c2*e^2 + c2*e^2*(2-2) = -2*c2*e^2 + 0 = -2*c2*e^2

From the initial condition y'(2) = 1, we can set up the equation:

-2*c2*e^2 = 1

Solving for c2:

c2 = -1/(2*e^2)

Now, substituting this value of c2 into the expression for y(x):

y(x) = c1*e^x + c2*x*e^x
= c1*e^x + (-1/(2*e^2))*x*e^x

For the initial condition y(2) = 0, we can substitute x=2 into this expression:

0 = c1*e^2 + (-1/(2*e^2))*2*e^2
0 = c1*e^2 - 1

Solving for c1:

c1 = 1/e^2

Now we can write the final expression for y(x):

y(x) = (1/e^2)*e^x - (1/(2*e^2))*x*e^x
= e^x/e^2 - (1/(2*e^2))*x*e^x
= (e^x - x*e^x)/(2*e^2)

So the correct answer to the initial-value problem is:

y(x) = (e^x - x*e^x)/(2*e^2)