How to Solve the Differential Equation y'' + y = tan^2(x)?

  • Thread starter Mark Brewer
  • Start date
  • Tags
    Parameters
In summary, when solving the differential equation y'' + y = tan2x, the solution is y = c1sinx + c2cosx + sin2x - xcosx(xsinx - 1) - lntanx + secx - cosx(sinxtanx - 2) -xsinx(cosx + 1). However, there may be errors in the parentheses and the integrals for tan2x were not correctly calculated. It is recommended to use the substitution tanx=sinx/cosx when using integration by parts.
  • #1
Mark Brewer
38
4

Homework Statement


y'' + y = tan2x

The Attempt at a Solution



yh = c1sinx + c2cosx

yp = -y1 ∫ (y2r/W) dx + y2 ∫ (y1r/W) dx

r = tan2x

y1 = sinx

y2 = cosx

W = 1

I'm using integration by parts, but I've realized that the trig functions repeat (trivial).

Is there another way to solve this equation or is by parts the way to go?
 
Physics news on Phys.org
  • #2
Show your integrals, please. What have you tried?
 
  • #3
ehild said:
Show your integrals, please. What have you tried?

Thank you for the reply.

I retried by parts and saw that trig identities simplify the integrals, so I don't have to do by parts a second time. I apologize for not displaying my integrals.

My answer is y = c1sinx + c2cos +cosx

if you still want to see my work I can display it, but it's a lot to type. Let me know.
 
  • #4
Mark Brewer said:
Thank you for the reply.

I retried by parts and saw that trig identities simplify the integrals, so I don't have to do by parts a second time. I apologize for not displaying my integrals.

My answer is y = c1sinx + c2cos +cosx

if you still want to see my work I can display it, but it's a lot to type. Let me know.
Is that really solution of the differential equation?
I would like to see your integrals and what you have tried.
 
  • #5
W = 1
r = tan2x
y1 = sinx
y2 = cosx

yh = c1sinx + c2cosx

yp = -y1 ∫ ((y2)(r)/W)dx + y2 ∫ ((y1)(r)/W)dx

yp = -sinx ∫ ((cosx)(tan2x)dx) + cosx ∫ ((sinx)(tan2x)dx)

yp = -sinx ∫ ((cosx)(sec2x +1)dx) + cosx ∫ ((sinx)(sec2x +1)dx)

There's two by parts labeled 1 (left side) and 2 (right side)

by parts 1

u = cosx , du = sinx dx
v = sec2x +1 , dv = tanx + x

-sinx(cosx)(tanx +x) - ∫ (sinxtanx - sinx)dx
-sinx(cosx)(tanx +x) + ∫ ((sin2x/cosx) - sinx)dx
-sinx(cosx)(tanx +x) + ∫ (((cos2x + 1(/(cosx) + sinx)dx
-sinx(cosx)(tanx +x) + ∫ (((cos2x + 1(/(cosx) - sinx)dx
-sinx(cosx)(tanx +x) + ∫ (1/cosx)dx + ∫(cosx)dx - ∫(sinx)dx
-sinxcosxtanx + (sinxcosx)x + ln cosx + sinx - cosx
-sin2x + (sinxcosx)x +ln cosx + sinx - cosx

by parts 2

u = cosx , du = sinx dx
v = sec2x +1 , dv = tanx + x

+ cosx(sinx)(tanx + x) -∫ (cosx)(tanx + x)dx
+ cosx(sinx)(tanx + x) -∫ (sinx)dx + ∫(cosx)dx
+ cosx(sinx)(tanx + x) +cosx + sinx
+ cosxsinxtanx + (cosxsinx)x + cosx + sinx
+ sin2x + (cosxsinx)x + cosx + sinx

y = c1sinx + c2cosx -sin2x + (sinxcosx)x +ln cosx + sinx - cosx+ sin2x + (cosxsinx)x + cosx + sinx

Final answer:

y = c1sinx + c2cosx + (sin2xcos2x)x2 +ln cosx + 2sinx

Thanks for having me type out this problem I found mistakes. How does this answer look?
 
  • #6
Mark Brewer said:
W = 1

yp = -sinx ∫ ((cosx)(tan2x)dx) + cosx ∫ ((sinx)(tan2x)dx)

yp = -sinx ∫ ((cosx)(sec2x +1)dx) + cosx ∫ ((sinx)(sec2x +1)dx)

tan2x is not the same as sec2x +1. Check. But I would not use the secant. Would do it with tan(x)=sin(x)/cos(x) instead.
I do not understand your way of integration by parts, either.
And W=-1.
 
  • #7
ehild said:
tan2x is not the same as sec2x +1. Check. But I would not use the secant. Would do it with tan(x)=sin(x)/cos(x) instead.
I do not understand your way of integration by parts, either.
Thank you, the secant should have been sec2x -1
 
  • #8
Mark Brewer said:
Thank you, the secant tan2 should have been sec2x -1
 
  • #9
Hi Ehild,

My apologies for thinking I could use sec2x - 1. I thought the derivation was tanx from sec2x. I'll use sinx/cosx.

Thank you again for the help.
 
  • #10
My new answer is extremely long.

y = c1sinx + c2cosx + sin2x - xcosx(xsinx - 1) - lntanx + secx - cosx(sinxtanx - 2) -xsinx(cosx + 1)
 
  • Like
Likes epenguin
  • #11
Mark Brewer said:
My new answer is extremely long.

y = c1sinx + c2cosx + sin2x - xcosx(xsinx - 1) - lntanx + secx - cosx(sinxtanx - 2) -xsinx(cosx + 1)

Still not correct, I am afraid. Check the parentheses. I can not tell where your mistakes are if you do not show your work.
You need the integrals ##\int(\cos(x)\tan^2(x)dx)## and ##\int(\sin(x)\tan^2(x)dx)## . How did you do them?Hint: when integrating by parts, integrate u'=sin(x).
 
Last edited:

Related to How to Solve the Differential Equation y'' + y = tan^2(x)?

1. What is the concept of "Variations of Parameters" in mathematics?

Variations of Parameters is a method used in differential equations to find a particular solution when the general solution is already known. It involves finding a set of functions, known as variation parameters, that when multiplied by the general solution, result in a particular solution.

2. How is the method of "Variations of Parameters" different from other methods of solving differential equations?

Variations of Parameters is different from other methods, such as the method of undetermined coefficients, in that it can be applied to a wider range of differential equations. It is also more precise and accurate in finding the particular solution.

3. What are the steps involved in using "Variations of Parameters" to solve a differential equation?

The steps for using Variations of Parameters are as follows:

  1. Find the general solution of the differential equation.
  2. Set up a system of equations using the variation parameters.
  3. Solve the system of equations to find the values of the variation parameters.
  4. Multiply the general solution by the variation parameters to obtain the particular solution.

4. Can "Variations of Parameters" be used to solve any type of differential equation?

While Variations of Parameters can be applied to a wide range of differential equations, it is most commonly used for second order linear differential equations with constant coefficients. It may not be suitable for all types of differential equations, such as non-linear or higher order equations.

5. Are there any limitations or drawbacks to using "Variations of Parameters"?

One limitation of Variations of Parameters is that it can be a more time-consuming and tedious method compared to other techniques for solving differential equations. It also requires a good understanding of the general solution and the variation parameters, which can be challenging for some students.

Similar threads

  • Calculus and Beyond Homework Help
Replies
7
Views
718
  • Calculus and Beyond Homework Help
Replies
21
Views
899
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
804
  • Calculus and Beyond Homework Help
Replies
6
Views
969
  • Calculus and Beyond Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
7
Views
748
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
5K
Back
Top