Where Did I Go Wrong in Solving This Integral Using Substitution?

In summary, the conversation discussed finding the integral of sin(x)*cos(x) using the substitution method. The person found the answer to be sin(x)^2 / 2, but when they checked with Maple and Mathematica, they got -cos(x)^2 / 2. They also noticed that their answer differed by a constant of 1, and upon further calculations, they realized that both answers were actually the same from a calculus perspective. They also mentioned that trigonometric functions often lead to different looking expressions that are actually equal. Finally, another person provided another way to solve the integral, which also resulted in a different but equivalent answer with a constant.
  • #1
Yankel
395
0
Hello,

I was trying to solve the integral of

sin(x)*cos(x)

using the substitution method, what I did was:

u=sin(x) and that yields du/dx = cos(x) and then du=cos(x)*dx

that comes to an integral of u*du, which is easy u^2 / 2 +C. substituting back gives the final answer

sin(x)^2 / 2

But, when I ran this integral in both Maple and Mathematica, I got this answer:

-cos(x)^2 / 2

Now I tried asking Maple if the two answers are the same, but it failed. I tried checking myself, using the relation sin(x)^2+cos(x)^2=1, and got to the conclusion that they don't. I don't see what I did wrong here...
 
Physics news on Phys.org
  • #2
Technically, you answer was not $\sin^{2}(x)/2$, but $\sin^{2}(x)/2+C.$ Likewise, the computer's answer was not $-\cos^{2}(x)/2$, but $-\cos^{2}(x)/2+C$. Since your two answers differ by a constant (namely, $1$), they are really the same answer from a calculus perspective.
 
  • #3
Ackbach said:
Technically, you answer was not $\sin^{2}(x)/2$, but $\sin^{2}(x)/2+C.$ Likewise, the computer's answer was not $-\cos^{2}(x)/2$, but $-\cos^{2}(x)/2+C$. Since your two answers differ by a constant (namely, $1$), they are really the same answer from a calculus perspective.

Or more clearly, $C_1$ and $C_2$. This happened to me a while ago, it tends to occur a lot with trigonometric functions because of their periodic identities, so you often end up with very different looking expressions which are in fact equal.. :confused:
 
  • #4
ah, I wasn't thinking about it...interesting.

well done to both of you ! thanks ! :)
 
  • #5
Just to be cheeky about it:
[tex]\int sin(x)~cos(x) dx = \frac{1}{2} \int 2 sin(x)~cos(x) dx = \frac{1}{2} \int sin(2x)dx[/tex]

After u = 2x:
[tex]= \int sin(x)~cos(x) dx = \frac{1}{2} \int sin(u) \cdot \frac{1}{2} du[/tex]

[tex]= -\frac{1}{4} cos(u) + C = -\frac{1}{4} cos(2x) + C[/tex]

and upon using [tex]cos(2x) = cos^2(x) - sin^2(x)[/tex]
[tex]\int sin(x)~cos(x) dx = \frac{1}{4} \left ( sin^2(x) - cos^2(x) \right ) + C[/tex]

which contains both your sin and cos terms and is also off by a constant from the other solutions. (Nerd)

-Dan
 

FAQ: Where Did I Go Wrong in Solving This Integral Using Substitution?

What is integration in computer problem solving?

Integration is the process of combining different components or systems into a unified whole. In computer problem solving, integration refers to the process of combining different software or hardware components to create a functional solution.

Why is integration important in computer problem solving?

Integration is important in computer problem solving because it allows different components to work together efficiently and effectively. It also reduces the complexity of a problem by breaking it down into smaller, manageable parts.

What are the types of integration in computer problem solving?

The two main types of integration in computer problem solving are vertical integration, which involves combining different layers of technology, and horizontal integration, which involves combining similar components or systems.

What are the steps involved in integrating computer systems?

The steps involved in integrating computer systems include identifying the components to be integrated, understanding their functions and compatibility, designing the integration process, testing the integration, and implementing the final solution.

How can integration errors be prevented in computer problem solving?

Integration errors can be prevented by conducting thorough testing, ensuring compatibility between components, and following best practices for integration. It is also important to have a backup plan in case of any errors during the integration process.

Similar threads

Back
Top