How to make a program that calculates this integration? Thanks I appreciate.

1 view (last 30 days)
I do not know how to make a symbolic integration for the two first integrals upon writing a program.

Accepted Answer

John D'Errico
John D'Errico on 31 Jul 2016
Edited: John D'Errico on 31 Jul 2016
To be honest, I'd probably do the inner integral (I assume that is on y) by hand, so we get that as:
(16 - 3*x^2 - z^2) - (x^2 + z*2) = 16 - 4*x^2 - 2*z^2
The other two integrals are as easy to write by hand too. So I'm not sure what the problem is here.
If you'd rather do it using syms, I'd split it up into three integrals to make it easier to read.
syms x y z
>> Iy = int(1,y,[x^2 + z^2,16-3*x^2-z^2])
Iy =
- 4*x^2 - 2*z^2 + 16
Given the limits of integration, I assume the middle integral must be on z, as the limits are a function of x. But you did write it as dy dx dz. Assuming the middle integral is on z, then you would write it as
Iz = int(Iy,z,[-sqrt(4-x^2),sqrt(4-x^2)])
You should do the rest. In the end, you should get a nice, round multiple of pi as the answer. But I don't want to do your homework for you.

More Answers (1)

Walter Roberson
Walter Roberson on 31 Jul 2016
Edited: Walter Roberson on 31 Jul 2016
syms x y z
int(int(int(1, y, x^2+z^2, 16-3*x^2-z^2), x, ........ so on

Tags

Community Treasure Hunt

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

Start Hunting!