symbolic integration with undefined variable

1 次查看(过去 30 天)
i created the following script code
syms r,x,r,z; a=int((r^2*x*z)/(r^2+z^2)^(3/2),0,2*pi) b=int(a, r, 0, r)
because i can't do definite integrals of multidimensional problems. But the answer for b is not making sense to me as i keep getting this piecewise answer that does not make sense. It appears that its trying to evaluate the value of z over which answer is valid. how can i force it to know that z is always a positive value > 0 so i can avoid this?
here is what i get out, note a is correct, but b is confused.
a = (2*pi^2*r^2*z)/(r^2 + z^2)^(3/2)
b = piecewise([z in {-1, 1}, (2*pi^2*r^3*z*hypergeom([3/2, 3/2], [5/2], -r^2))/3], [not z in {-1, 1}, int((2*pi^2*r^2*z)/(r^2 + z^2)^(3/2), r, 0, r)])

采纳的回答

David Sanchez
David Sanchez 2014-9-17
Point out that z>0 like this:
>> assume(z>0);
>> b=int(a, r, 0, r)
b =
-2*pi^2*z*(log(z) - log(r + (r^2 + z^2)^(1/2)) + r/(r^2 + z^2)^(1/2))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by