# Simple differential equation

y''+y=5cos(x)

## Homework Equations

y=Acos(x)+Bsin(x)
e^ix=cos(x)+isin(x)

## The Attempt at a Solution

I tried using compbinations of these equations to try and solve but i'm lost. Any suggestions would be greatly appreciated!

fzero
Homework Helper
Gold Member
y=Acos(x)+Bsin(x)

is the solution to the homogenous equation. The particular solution must be linearly independent from them. Try multiplying by some power of x to generate a guess for the particular solution.

try multiplying what by a power of x?

fzero
Homework Helper
Gold Member
try multiplying what by a power of x?

The solutions to the homogeneous equation. Try A xa cos x and B xb sin x and see if a and b can be chosen to get a solution.

is y= -2.5xcos(x) right?

fzero
Homework Helper
Gold Member
Recheck your algebra, the sin term is actually the particular solution.

oh yeah i know i put cos by accident, but that is the solution right? I arrived at this solution by a long trial and error method. any way to quickly get at it in general?

fzero