how can I integrate this function (1/(1+x.^2)) in matlab

조회 수: 3 (최근 30일)
suez canal university
suez canal university 2018년 8월 5일
댓글: Walter Roberson 2018년 8월 5일
I used many numerical integration methods like integral simpson trapoizal int but the graph is different and not like the one already I have so can I know please how to do this in matlab the function is 1/(1+x.^2) intervals of this integration contains variable called t takes values from [-15:15] now intervals from [ -t^1/2, Inf]

답변 (3개)

Stephan
Stephan 2018년 8월 5일
편집: Stephan 2018년 8월 5일
Hi,
use integral function for this:
fun = @(x) 1./(1+x.^2)
sol = integral(fun,-15,15)
This gives you the numeric solution in the bounds [-15, 15].
An alternative solution (if you have access to symbolic toolbox) is:
syms x
fun = 1/(1+x^2)
sol_1 = int(fun)
sol_2 = int(fun,0,inf)
sol_3 = int(fun,-15,15)
Best regards
Stephan
  댓글 수: 11
Walter Roberson
Walter Roberson 2018년 8월 5일
I used Maple.
Walter Roberson
Walter Roberson 2018년 8월 5일
vpaintegral() was added to the Symbolic Toolbox in R2016b.

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


suez canal university
suez canal university 2018년 8월 5일
Thanks for your answer but my interval is [ -t^(1/2),Inf] and (t) is a variable takes values from -15 to 15

suez canal university
suez canal university 2018년 8월 5일
The answer I got conatins some complex numbers so how can I treat this.
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 8월 5일
You cannot avoid that. You have t = -15 to +15 and you want to integrate over -t^(1/2) to infinity, but when t is negative, t^(1/2) is complex.

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

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by