using method of undetermined coefficients

d^2y/dx^2 -5 dy/dx+6y=xe^x

To solve the differential equation using the method of undetermined coefficients, we assume that the particular solution has the same form as the nonhomogeneous term and has undetermined coefficients. In this case, the nonhomogeneous term is 'xe^x'.

Step 1: Find the complementary function
To find the complementary function, we solve the associated homogeneous equation:
d^2y/dx^2 -5 dy/dx + 6y = 0

The characteristic equation is:
r^2 - 5r + 6 = 0

Factoring the equation, we get:
(r - 2)(r - 3) = 0

So the complementary function is:
y_c = c1 * e^2x + c2 * e^3x, where c1 and c2 are arbitrary constants.

Step 2: Find the particular solution
We assume a particular solution in the form of:
y_p = Ax^2 * e^x, where A is an undetermined coefficient.

Taking derivatives of y_p:
dy_p/dx = 2Ax * e^x + Ax^2 * e^x
d^2y_p/dx^2 = 2A * e^x + 2Ax * e^x + Ax^2 * e^x

Substituting these derivatives into the differential equation:
(2A * e^x + 2Ax * e^x + Ax^2 * e^x) - 5(2Ax * e^x + Ax^2 * e^x) + 6(Ax^2 * e^x) = xe^x

Simplifying the equation:
(2A - 10Ax + 6Ax^2) * e^x = xe^x

Equating the coefficients of like terms on both sides:
2A - 10Ax + 6Ax^2 = x

Comparing the coefficients:
-10A = 0 --> A = 0
2A = 1 --> 2 * 0 = 1 (which is not possible)
6A = 0 --> 6 * 0 = 0 (which is already satisfied)

Since we have a contradiction with the term 2A = 1, it means that the assumed form of the particular solution was incorrect.

Step 3: Revised particular solution
Since the term 'x' in the nonhomogeneous term 'xe^x' is also present in the homogeneous equation (associated with 'c1' in the complementary function), we need to multiply the assumed particular solution by 'x' to avoid overlap.

Let's assume a revised particular solution in the form of:
y_p = x(Ax^2 * e^x), where A is an undetermined coefficient.

Taking derivatives of y_p:
dy_p/dx = 3Ax^2 * e^x + Ax^3 * e^x
d^2y_p/dx^2 = 3Ax^2 * e^x + 6Ax * e^x + Ax^3 * e^x

Substituting these derivatives into the differential equation:
(3Ax^2 * e^x + 6Ax * e^x + Ax^3 * e^x) - 5(3Ax^2 * e^x + Ax^3 * e^x) + 6(Ax^3 * e^x) = xe^x

Simplifying the equation:
(6Ax * e^x) = xe^x

Comparing the coefficients:
6Ax = x --> 6A = 1 --> A = 1/6

Therefore, the revised particular solution is:
y_p = x((1/6)x^2 * e^x)

Step 4: General solution
The general solution is the sum of the complementary function and the particular solution:
y = y_c + y_p
= c1 * e^2x + c2 * e^3x + x((1/6)x^2 * e^x), where c1 and c2 are arbitrary constants.