# Calculus II - Solving Second Order Differential Equation

## Homework Statement

Which of the following functions are soltuions of the differntial equation y''+y=sin(x)?
a) y=cos(x) b) y=sin(x) c) y=1/2*xcos(x) d) y=1/2*x*sin(x)

## The Attempt at a Solution

I'm kind of lost on how to solve this problem. I don't think this is a standard calculus II problem but it was on a packet that we were asked to solve.

I learned from the internet that you can solve a second differential order equation of form
Af''(x) + Bf'(x) + Cf(x) = 0
By setting f'(x) as r_1, f''(x) as r_2, f(x) as 1
then
Ar^2 + Br + C = 0
and plugging into
y(x) = c_1 e^(r_1*x) + c_2*e^(r_2*x)
were c_1 and c_2 are just some constants that can be solved for if your given initial conditions

I'm unsure how to solve this problem because it's of a different form of
f''(x) + f(x) = sin(x)
I'm unsure what to do about the sin(x) term in this case and not sure what to do sense I don't have initial condition and how to come up with the constant terms as a result...

Thanks for any Help!

Thanks for your response. No I have never seen type of equation before. Is it a standard calculus II topic? That pdf file looks very useful, I'll see if I can solve the problem after looking over it.

Hootenanny
Staff Emeritus
Gold Member
Thanks for your response. No I have never seen type of equation before. Is it a standard calculus II topic? That pdf file looks very useful, I'll see if I can solve the problem after looking over it.
I am not familiar with the US education system, so I can't comment. However, over here in the UK, this is first year undergraduate level.

## Homework Statement

Which of the following functions are soltuions of the differential equation y''+y=sin(x)?
a) y=cos(x) b) y=sin(x) c) y=1/2*xcos(x) d) y=1/2*x*sin(x)

Thanks for any Help!

You can also, when checking for solutions, think in the other direction, which makes the calculation quite simple.

find y'' of the suggested y=...

Calculate y''+y and see if this equals sin(x)

I think you'll find that's far easier than solving the 2nd order differential equation.

When I learned about diff eqs this spring we started approaching possible solutions this way, later we learn't how to solve such differential equations.

dynamicsolo
Homework Helper
You are not being asked to solve the differential equation (inhomogeneous second-order ordinary differential equations are not a Calculus II topic), but to "verify" a solution. Which choice works in the equation?

I'm actually getting none of them

a) y=cos(x)
y'=-sin(x)
y''=-cos(x)
y''+y=-cos(x)+cos(x)=0

b)y=sin(x)
y'=cos(x)
y''=-sin(x)
y''+y=-sin(x)+sin(x)=0

c)y=(xcos(x))/2
y'=(-xsin(x))/2+cos(x)/2
y''=-(xcos(x))/2-sin(x)
y''+y=(-xcos(x))/2-sin(x)+(xcos(x))/2=-sin(x)

d)y=(xsin(x))/2
y'=sin(x)/2+(xcos(x))/2
y''=cos(x)/2+cos(x)/2-(xsin(x))/2=cos(x)-(xsin(x))/2
y''+y=cos(x)-(xsin(x))/2+(xsin(x))/=cos(x)

Is the problem missed up or am I doing something wrong because I'm getting that all the answers are wrong?

I can't find something wrong there...

Mark44
Mentor
As you show the problem, none of the given functions is a solution. It would be a good idea to check that you wrote them down correctly, particularly the ones for parts c and d. If you missed a sign, that would affect your answer.

Hootenanny
Staff Emeritus
Gold Member
You are not being asked to solve the differential equation (inhomogeneous second-order ordinary differential equations are not a Calculus II topic), but to "verify" a solution. Which choice works in the equation?
None of them do, which is why I suggested that the OP look into how to solve the problem himself. I wasn't sure whether that was part of the exercise or not.

dynamicsolo
Homework Helper
None of them do, which is why I suggested that the OP look into how to solve the problem himself. I wasn't sure whether that was part of the exercise or not.

If it's a multiple-choice question for practice, finding the error is probably not part of the exercise.

I guess I want to ask whether this set of problems came from a published source or from an instructor. It wouldn't be the first time I'd seen someone make up a bunch of problems and not check for typoes or whether a problem could even be solved as stated. I suspect the answer was intended to be (c), but a minus sign was omitted on the inhomogeneous term or on the solution. [I agree that there are no errors in GreenPrint's calculations.]

It actually came from my professor, I guess the problem is messed up, I'm glad I didn't do something wrong =). It's strange, the difference between education systems, it's something taught in first year undergraduate math but not in the US apparently... I guess they have better education systems elsewhere lol, that doesn't surprise me

Hootenanny
Staff Emeritus
Gold Member
If it's a multiple-choice question for practice, finding the error is probably not part of the exercise.

I guess I want to ask whether this set of problems came from a published source or from an instructor. It wouldn't be the first time I'd seen someone make up a bunch of problems and not check for typoes or whether a problem could even be solved as stated. I suspect the answer was intended to be (c), but a minus sign was omitted on the inhomogeneous term or on the solution. [I agree that there are no errors in GreenPrint's calculations.]
Fair point. I just didn't want to give the answer away if this wasn't the case

Mark44
Mentor
Solving the differential equation is probably too advanced for a Calc II course, but verifying that a given function is a solution of a differential equation is appropriate, IMO. For problems like this, all you're doing is finding out whether the given function and it's relevant derivatives make the differential equation identically true.

vela
Staff Emeritus