Find the second derivative of an integral function

조회 수: 4 (최근 30일)
Yaser Khojah
Yaser Khojah 2018년 10월 11일
편집: Bruno Luong 2018년 10월 12일
Can anyone please help me with this problem. I have an integral function that I would like to differentiate it twice to find if it is convex or not. I'm not really sure how to do it in MATLAB. First, I have to find the second derivative by MATLAB to compare to my analytical answer. Here is the function. integral of f with respect to t from t0 to ts. f and the rest as below:
if true
% code
syms price lamda t r t0 ts
fun = price .* exp(-lamda .* t) .* r;
x = int(fun,t,[t0 ts])
Y = diff(X)
end
I do not need to integrate f, I just need to find its second derivative and this function happens to be an integral.
  댓글 수: 8
Yaser Khojah
Yaser Khojah 2018년 10월 12일
This is my function. I think what you sent will not give me what I want.
Bruno Luong
Bruno Luong 2018년 10월 12일
편집: Bruno Luong 2018년 10월 12일
Yes it does.
* dfun/dr = integral in [t0 ts] of price*exp(-lamda*t) dt;
* d^2fun/dr^2 = 0
You can pull out r out of the integral if it helps you to understand, since it does not depends on the integration variable t.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by