how to define a double integral with symbolic upper limits

I want to define a double integral, like this
f(h) = \int_0^h (\int_0^1 xy dx) dy,
where h is a variable.
I try to use command twice: int(int(~,~,~),~,~), but it does not work.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 10 月 5 日

0 投票

syms x y h
f(h) = int( int(x*y, x, 0, 1), y, 0, h)

3 件のコメント

Yufei Cao
Yufei Cao 2018 年 10 月 5 日
Dear Walter,
Thanks for your answer.
I find that if the function xy becomes (x.^2 + y.^2).^(1/3), it will not work, since I find matlab int analytically evaluates the first integral and then the second. I would like to define a upper limit integral that can compute numerically when the first integral cannot be evaluated. Thanks in advance.
Walter Roberson
Walter Roberson 2018 年 10 月 5 日
編集済み: Walter Roberson 2018 年 10 月 5 日
matlabFunction(int(int((x.^2 + y.^2)^(1/3), x, 0, 1),0, h),h)
or
f(h) = vpaintegral( vpaintegral(x*y, x, 0, 1), y, 0, h)
Yufei Cao
Yufei Cao 2018 年 10 月 5 日
Dear Walter,
Thanks a lot.
I found the first way does not work, see the pic.
But the second one works very well. Thank you very much.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

質問済み:

2018 年 10 月 5 日

コメント済み:

2018 年 10 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by