Borrar filtros
Borrar filtros

Inconsistent results from "int" function

1 visualización (últimos 30 días)
YoungJoo Lee
YoungJoo Lee el 27 de Nov. de 2022
Comentada: YoungJoo Lee el 27 de Nov. de 2022
Hi, everyone. For the same question, the "int" function provided me with different results.
syms x y
int(x*y/24+y^2/48,x)
int((y*(2*x + y))/48,x)
The second line gave me "(x*y*(x + y))/48" which was what I originally wanted,
but the third line gave me "'(y*(2*x + y)^2)/192" which is wrong.
Can anyone explain the reason?
Thanks for your time and help in advance!

Respuesta aceptada

Alan Stevens
Alan Stevens el 27 de Nov. de 2022
You can express '(y*(2*x + y)^2)/192 as (x*y*(x + y))/48+y^3/198
As far as the integral is concerned y is a constant, so the two results are the same to within a constant, which is all you can guarantee from an integral with no specific limits.
  5 comentarios
Torsten
Torsten el 27 de Nov. de 2022
I believe, for my problem, providing something like "(x*y*(x + y))/48+C (where C is a constant)" as output would be more appropriate.
"(x*y*(x + y))/48+C(y) (where C is a function solely depending on y)"
YoungJoo Lee
YoungJoo Lee el 27 de Nov. de 2022
Oh, sure. Thanks for the correction!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by