Problem Integrating sin(2*x)

5 visualizaciones (últimos 30 días)
Ricardo
Ricardo el 5 de Mzo. de 2014
Comentada: Gustavo Leal el 9 de Oct. de 2017
>> syms x >> f=sin(2*x)
f =
sin(2*x)
>> int(f)
ans =
sin(x)^2
>>
I am sure it is wrong because it should be -1/2+sin(x)^2

Respuesta aceptada

Paul
Paul el 5 de Mzo. de 2014
The integral is:
sin(x)^2 + C
but Matlab just doesn't show the constant. How do you get the -1/2? Because if you differentiate the integral (sin(x)^2 + C) you get:
2*sin(x)*cos(x) = sin(2*x)
And the constant differentiated gives 0 since it doesnt depend on x.
  4 comentarios
Ricardo
Ricardo el 5 de Mzo. de 2014
Editada: Ricardo el 5 de Mzo. de 2014
All right, Thanks!!
Gustavo Leal
Gustavo Leal el 9 de Oct. de 2017
sin(pi)^2 != -cos (2pi)/2 ,for example, something its wrong with this function at MATLab

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by