---
title: "Solve (D²+2D+1)y=eˣ cos x"
subject: "Mathematics I"
chapter: 4
key: "semester_1/mathematics_i:de-d2-2d-1-ex-cosx"
source: https://www.bctengineer.com/q/semester_1/mathematics_i/de-d2-2d-1-ex-cosx
site: BCT Engineering
---

# Solve (D²+2D+1)y=eˣ cos x

Mathematics I · Chapter 4: Ordinary Differential Equations and their Applications

- Asked in: 2068 Shrawan
- Video: [Solve: (D²+2D+1)y= xcosx | Linear Differential Equation with Constant Coefficient| C.F. and P.I.](https://www.youtube.com/watch?v=lVM7BEOhsQk) — RK Eduworld (Classic)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_1/mathematics_i/de-d2-2d-1-ex-cosx
- Whole chapter: https://www.bctengineer.com/md/semester_1/mathematics_i/chapter-4

## Question

Find the general solution of the differential equation (D² + 2D + 1)y = eˣ cos x.

## Short answer

Linear ODE with constant coefficients; CF = (c₁ + c₂x)e^(−x), PI = eˣ(3 cos x + 4 sin x)/25. General solution: y = (c₁ + c₂x)e^(−x) + eˣ(3 cos x + 4 sin x)/25.

## Answer

The equation is (D² + 2D + 1)y = eˣ cos x.

#### Complementary function
m² + 2m + 1 = 0, so m = −1, −1.

CF = (c₁ + c₂x)e^(−x)

#### Particular integral
Replace D by D + 1 and take eˣ outside:

PI = eˣ · 1/[(D + 1)² + 2(D + 1) + 1] · cos x = eˣ · 1/(D² + 4D + 4) · cos x

Put D² = −1: denominator 4D + 3.

 = eˣ · (3 − 4D)/(9 − 16D²) · cos x

With D² = −1, 9 − 16D² = 25:

 = (eˣ/25)(3 cos x − 4D cos x) = (eˣ/25)(3 cos x + 4 sin x)

#### General solution
**y = (c₁ + c₂x)e^(−x) + (eˣ/25)(3 cos x + 4 sin x)**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. CF is:
   A. (c1 + c2 x)e^(-x)
   B. c1 e^x + c2 e^(-x)
   C. (c1 + c2 x)e^x
   D. e^(-x)(c1 cos x + c2 sin x)
   Answer: A. Repeated root -1. (Key point: Complementary function)

2. Replacing D by D + 1 gives:
   A. D^2 + 4D + 4
   B. D^2 + 2D + 1
   C. D^2 + 4D + 1
   D. D^2 + 4
   Answer: A. (D+1)^2 + 2(D+1) + 1. (Key point: Shifted operator)

3. The operator acting on cos x becomes:
   A. 4D + 5
   B. D + 3
   C. 4D + 3
   D. 3 - 4D
   Answer: C. -1 + 4D + 4. (Key point: Using D^2 = -1)

4. The PI is:
   A. (e^x/25)(3 cos x + 4 sin x)
   B. (e^x/7)(3 cos x + 4 sin x)
   C. (e^x/25)(3 cos x - 4 sin x)
   D. (e^x/5)(cos x + sin x)
   Answer: A. (3 - 4D)/25 cos x = (3 cos x + 4 sin x)/25. (Key point: Final PI)

## Close variants set in other exams

- [Solve xy(p²+2)=2py³+x³](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-xy-p2-plus-2) — Mathematics I, chapter 4, asked 2×
- [Solve p³−4xyp+8y²=0](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-p3-4xyp-8y2) — Mathematics I, chapter 4, asked 2×

## Related in Mathematics I

- [Solve (D²−2D+5)y=e^(2x) sin x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-d2-2d-5-e2x-sinx) — Mathematics I, chapter 4, asked 2×
- [Solve (D²+2D+1)y=eˣ+x²](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-d2-2d-1-ex-x2) — Mathematics I, chapter 4
- [Solve (D²−2D+5)y=10 sin x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-d2-2d-5-10-sinx) — Mathematics I, chapter 4
- [Solve sin x dy/dx + y cos x = x sin x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-sinx-dy-dx-y-cosx) — Mathematics I, chapter 4
- [Solve y''−y=x² cos x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-d2-y-x2-cosx) — Mathematics I, chapter 4
- [Pedal equation of r^m = a^m cos mθ](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Apedal-equation-rm-cos-m-theta) — Mathematics I, chapter 1, asked 2×

## Related in other subjects

- [Solve a partial differential equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-a-partial-differential-equation-two) — Mathematics III, chapter 4
- [Solve a partial differential equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-a-partial-differential-equation) — Mathematics III, chapter 4
- [LC oscillation differential equation](https://www.bctengineer.com/question.md?key=semester_1%2Fengineering_physics%3Alc-oscillation-differential-equation) — Engineering Physics, chapter 1
- [Solve an integral equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-an-integral-equation) — Mathematics III, chapter 4
