The answer this trigonometric integration example is wrong despite attempts to remedy it. Anyone knows why?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Respuesta aceptada
Ameer Hamza
el 29 de Sept. de 2020
Editada: Ameer Hamza
el 29 de Sept. de 2020
It is the correct result, it is just a different way of writing it.
>> syms x
>> f = 2*cos(x) + sin(x)
f =
2*cos(x) + sin(x)
>> int_f = int(f)
int_f =
-2*cos(x/2)*(cos(x/2) - 2*sin(x/2))
>> simplify(diff(int_f)) % same expression back
ans =
2*cos(x) + sin(x)
3 comentarios
Steven Lord
el 29 de Sept. de 2020
If you want to test if Symbolic Math Toolbox can prove that two symbolic expressions that look different actually represent the same quantity you can use isAlways.
>> syms x
>> f1 = sin(x)
f1 =
sin(x)
>> f2 = (exp(1i*x)-exp(-1i*x))/2i
f2 =
(exp(-x*1i)*1i)/2 - (exp(x*1i)*1i)/2
>> isAlways(f1 == f2)
ans =
logical
1
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

