Hi, I want to find the solution to this integral as a function of x: integral(between 0 and x) of (x-z)dz. The answer should be x^2/2. Thanks!

댓글 수: 2

John D'Errico
John D'Errico 2020년 6월 3일
And what, since this is surely homework, have you tried? Have you tried using int? Read the help and the examples for int. I just did it, and indeed, the answer seems to be x^2/2. So why not make an effort?
David Cuberes
David Cuberes 2020년 6월 3일
John, it is research, not homework. Thanks for asking! This is what I have tried:
fun=@(x-z)dz;
q=integral(fun,0,x)

댓글을 달려면 로그인하십시오.

답변 (1개)

Stephan
Stephan 2020년 6월 3일

1 개 추천

What you are looking for is an analytical solution. The integral function does solve numeric. To solve symbolic use int as John already pointed out. Im sure if you read the informations given in the link you will get it very fast.

댓글 수: 4

David Cuberes
David Cuberes 2020년 6월 3일
Thanks, Stephan. It works doing this:
syms x z
expr = x-z;
Fz = int(expr,z,[0 x])
Stephan
Stephan 2020년 6월 3일
Did you notice that you can accept and/or vote for useful answers?
David Cuberes
David Cuberes 2020년 6월 3일
I gave your comment a thumbs up. Thanks. I am new in this matlab world and in this forum.
Stephan
Stephan 2020년 6월 3일
Feel free to ask the community and be welcome here!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2020년 6월 3일

댓글:

2020년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by