How to solve integral within an integral with symbolic limit

2 views (last 30 days)
Hi,
I want to evaluate following integral which contains another integral inside. spol, which is a function of theta,is the lower limit of internal integral. The internal integral then will be multiplied to other function and will be differentiate.
Below is my coding:
a = 2;b = 1;c = 1.2*a;d = 1.2*b;
% E and K are elliptical integrals
syms theta dSigma
spol = 2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 - 5/2;
fpol = @(w)((1-((a*cos(theta))^2/(a^2+w))-((b*sin(theta))^2/(b^2+w)))/(sqrt((a^2+w)*(b^2+w)*w)));
gap = (Po/Estar)*(((int(fpol,spol,1000000))*a*b/2)- (2*d*(K-(((a*cos(theta))^2)*(K-E)/(e^2*c^2))-b*sin(theta)*(E/(e^2*d^2)-K/(e^2*c^2)))));
dGap = diff(gap);
dWork = int((2*c*d-2*a*b)*(1-cos(2*theta))*dSigma/dGap,0,pi/2);
The result that I get still contain the variable w and theta. I am hoping to get an equation of dWork in terms of dSigma only.
  4 Comments
Star Strider
Star Strider on 22 Jul 2015
In your ‘dWork’ integral, I don’t see that you’re telling the int function the variable you want to integrate with respect to. See specifically the documentation for var.
n hmz
n hmz on 22 Jul 2015
Hi Star Strider, I have corrected the coding. Thanks for pointing out the error

Sign in to comment.

Answers (1)

Torsten
Torsten on 22 Jul 2015
syms theta, w, ...
spol = 2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 - 5/2;
fpol=((1-((a*cos(theta))^2/(a^2+w))-((b*sin(theta))^2/(b^2+w)))/(sqrt((a^2+w)*(b^2+w)*w)));
gap = (Po/Estar)*(((int(fpol,w,spol,1000000))*a*b/2)- (2*d*(K-(((a*cos(theta))^2)*(K-E)/(e^2*c^2))-b*sin(theta)*(E/(e^2*d^2)-K/(e^2*c^2)))));
dGap = diff(gap,theta);
dWork = int((2*c*d-2*a*b)*(1-cos(2*theta))*dSigma/dGap,theta,0,pi/2);
But I don't think that you will get an analytical expression for dWork.
Best wishes
Torsten.
  3 Comments
Torsten
Torsten on 22 Jul 2015
If "int" works in both places, w and theta can not be part of the result if you used the above code.
What do you get for gap ?
What do you get for dWork ?
Best wishes
Torsten.
n hmz
n hmz on 22 Jul 2015
These are the results that I obtained:
gap =
(7539644829278696972233784146527*sin(theta))/9671406556917033397649408 + (23870099194513516803444108488855*cos(theta)^2)/21760664753063325144711168 + (8969566350051581*int(-((4*cos(theta)^2)/(w + 4) + sin(theta)^2/(w + 1) - 1)/(w*(w + 1)*(w + 4))^(1/2), w, 2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 - 5/2, 1000000))/17179869184 - 130669760193249859413711502947117/48357032784585166988247040
dWork =
int(-(dSigma*((44*cos(2*theta))/25 - 44/25))/((7539644829278696972233784146527*cos(theta))/9671406556917033397649408 - (23870099194513516803444108488855*cos(theta)*sin(theta))/10880332376531662572355584 + (8969566350051581*int(-((2*cos(theta)*sin(theta))/(w + 1) - (8*cos(theta)*sin(theta))/(w + 4))/(w*(w + 1)*(w + 4))^(1/2), w, 2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 - 5/2, 1000000))/17179869184 - (8969566350051581*(3*cos(theta)*sin(theta) + (12*cos(theta)*sin(theta)^3 - 60*cos(theta)*sin(theta) + 48*cos(theta)^3*sin(theta))/(4*(16*cos(theta)^4 + 8*cos(theta)^2*sin(theta)^2 - 24*cos(theta)^2 + sin(theta)^4 + 6*sin(theta)^2 + 9)^(1/2)))*((4*cos(theta)^2)/(2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 + 3/2) + sin(theta)^2/(2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 - 24*cos(theta)^2 + 6*sin(theta)^2 + sin(theta)^4 + 8*cos(theta)^2*sin(theta)^2 + 9)^(1/2)/2 - 3/2) - 1))/(17179869184*((2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 + 8*cos(theta)^2*sin(theta)^2 - 24*cos(theta)^2 + sin(theta)^4 + 6*sin(theta)^2 + 9)^(1/2)/2 - 3/2)*(2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 + 8*cos(theta)^2*sin(theta)^2 - 24*cos(theta)^2 + sin(theta)^4 + 6*sin(theta)^2 + 9)^(1/2)/2 + 3/2)*(2*cos(theta)^2 + sin(theta)^2/2 + (16*cos(theta)^4 + 8*cos(theta)^2*sin(theta)^2 - 24*cos(theta)^2 + sin(theta)^4 + 6*sin(theta)^2 + 9)^(1/2)/2 - 5/2))^(1/2))), theta, 0, pi/2)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!