MATLAB int function problem while evaluating a symbolic definite integral

17 visualizaciones (últimos 30 días)
this is my code
syms x y z b
assume(b, 'positive')
h(x,y,z) = z /(x^2 + y^2 + z^2)^(3/2) ;
int(h, x , [0 b])
i want to get the result of this integral wich is:
(2 b z)/((y^2 + z^2) Sqrt[b^2 + y^2 + z^2])
but instead i get :
ans(y, z) =
piecewise(y^2 + z^2 == 1 & ((z^2)^(1/2) == z | z + (z^2)^(1/2) == 0), (b*z)/(b^2 + 1)^(1/2), y^2 + z^2 ~= 1 | (z^2)^(1/2) ~= z & z + (z^2)^(1/2) ~= 0, int(z/(x^2 + y^2 + z^2)^(3/2), x, 0, b))
what can i do to get the first answer ? is there something wrong in my code ?
  1 comentario
Walter Roberson
Walter Roberson el 10 de Sept. de 2020
Your proposed answer is not correct when there are certain relationships between the complex values x, y, z .
You have the assumption that b > 0, which implies that b is real, but the calculation needs to take into account that x, y, z are complex.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Sept. de 2020
simplify(ans, 'steps', 100)

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by