Question: derivative of an implicit function

Dear all,

Following the comments I am editing this post:

I have a function F of variables (r1,r2,theta1,theta2,r,theta,a). r1, r2,theta1,theta2 are function of r,  theta and a. I want to take derivative of F with respect to a. r and theta are independent of a . I expressed everything in terms of 'a' as a function of 'a' at first. Then I use diff(F, a). I see there is an error in the final expression G .There is a restriction that theta1 should lie between -Pi to Pi and theta2 between 0 to 2*Pi. I speculate this is the source of error. Work sheet is attached. Reason: value of G: integration in 0 to pi/4 gives some  value but for 0 to pi it evaluates to zero and so is the case with 0 to 2*Pi. As "G "physically represents energy it must be a positive value.
 


restart;

theta1 := unapply(arctan(r*sin(theta)/(r*cos(theta)-a)), a);

proc (a) options operator, arrow; arctan(r*sin(theta)/(r*cos(theta)-a)) end proc

(1)

 

## theta1 -->[-Pi,Pi] and theta2-->[0,2*Pi]

NULL

theta2 := unapply(arctan(r*sin(theta)/(r*cos(theta)+a)), a);

proc (a) options operator, arrow; arctan(r*sin(theta)/(r*cos(theta)+a)) end proc

(2)

``

r1:=unapply(sqrt((r*cos(theta)-a)^2+r^2*(sin(theta))^2),a);r2:=unapply(sqrt((r*cos(theta)+a)^2+r^2*(sin(theta))^2),a);

proc (a) options operator, arrow; ((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2) end proc

 

proc (a) options operator, arrow; ((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2) end proc

(3)

sigma12:=0;sigma22:=sigma;

0

 

sigma

(4)

plot(arctan(tan(x)), x = (1/2)*Pi .. Pi)

 

## I have to use a constraint that

assume(theta1(a) < Pi, theta1(a) > -Pi, theta2(a) > 0, theta2(a) < 2*Pi, a>0,r>0)

u1:=(1+nu)*sigma22*sqrt(r1(a)*r2(a))*(4*(1-2*nu)*cos((theta1(a)+(theta2(a)))/2)-4*r*(1-nu)*cos(theta)/sqrt(r1(a)*r2(a))-2*r^2/(r1(a)*r2(a))*(cos((theta1(a)+(theta2(a)))/2)-cos(2*theta-theta1(a)/2-(theta2(a))/2)))/(4*E)+(1+nu)*sigma12*sqrt(r1(a)*r2(a))*(2*(1-2*nu)*sin((theta1(a)+(theta2(a)))/2)-2*r*(1-nu)*sin(theta)/sqrt(r1(a)*r2(a))+1*r^2/(r1(a)*r2(a))*sin(theta)*cos(theta-theta1(a)/2-(theta2(a))/2))/(E);

 

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(5)

NULL

u2:=(1+nu)*sigma*sqrt(r1(a)*r2(a))*(8*(1-nu)*sin((theta1(a)+(theta2(a)))/2)-4*r*(nu)*sin(theta)/sqrt(r1(a)*r2(a))-2*r^2/(r1(a)*r2(a))*(sin((theta1(a)+(theta2(a)))/2)+sin(2*theta-theta1(a)/2-(theta2(a))/2)))/(4*E)+(1+nu)*sigma12*sqrt(r1(a)*r2(a))*((1-2*nu)*cos((theta1(a)+theta2(a))/2)+2*r*(1-nu)*cos(theta)/sqrt(r1(a)*r2(a))-1*r^2/(r1(a)*r2(a))*sin(theta)*sin(theta-theta1(a)/2-theta2(a)/2))/(E);

 

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(6)

 

## get u_r and u_theta as u[1] and u[2]

u[1] := u1*cos(theta)+u2*sin(theta);

(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))*cos(theta)/E+(1/4)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))*sin(theta)/E

(7)

u[2] := -sin(theta)*u1+cos(theta)*u2;

-(1/4)*sin(theta)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(4*(1-2*nu)*cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*(1-nu)*cos(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(cos((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-cos(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E+(1/4)*cos(theta)*(1+nu)*sigma*(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)*(8*(1-nu)*sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-4*r*nu*sin(theta)/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2))^(1/2)-2*r^2*(sin((1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))+(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(2*theta-(1/2)*arctan(r*sin(theta)/(r*cos(theta)-a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/(((r*cos(theta)-a)^2+r^2*sin(theta)^2)^(1/2)*((r*cos(theta)+a)^2+r^2*sin(theta)^2)^(1/2)))/E

(8)

Diff_ur := simplify(diff(u[1], a));

(1/2)*sigma*(1+nu)*a*(-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*cos(theta)*(a-r)*(a+r)*cos(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*sin(theta)*(a^2+r^2)*sin(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+((a^2*r^2-r^4)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(3*nu-5/2)*r^2+a^2*(nu-1/2)))*cos(theta)*cos((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-sin(theta)*((2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*(a^2+r^2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(a^2+r^2)*(nu-1)))*sin((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a))))/((-2*cos(theta)*a*r+a^2+r^2)^(3/2)*(2*cos(theta)*a*r+a^2+r^2)^(3/2)*((-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2))^(1/2)*E)

(9)

``

 

Diff_ut := simplify(diff(u[2], a));

-(1/2)*sigma*(1+nu)*a*(-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*sin(theta)*(a^2+r^2)*cos(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))-(-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*cos(theta)*(a-r)*(a+r)*sin(2*theta+(1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+sin(theta)*((2*cos(theta)*a*r+a^2+r^2)^(1/2)*r^2*(a^2+r^2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(a^2+r^2)*(nu-1/2))*(2*cos(theta)*a*r+a^2+r^2))*cos((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))+((a^2*r^2-r^4)*(2*cos(theta)*a*r+a^2+r^2)^(1/2)*(-2*cos(theta)*a*r+a^2+r^2)^(1/2)-4*(-2*cos(theta)*a*r+a^2+r^2)*(-4*r^2*(nu-3/4)*cos(theta)^2+(3*nu-2)*r^2+a^2*(nu-1))*(2*cos(theta)*a*r+a^2+r^2))*sin((1/2)*arctan(r*sin(theta)/(-r*cos(theta)+a))-(1/2)*arctan(r*sin(theta)/(r*cos(theta)+a)))*cos(theta))/((-2*cos(theta)*a*r+a^2+r^2)^(3/2)*(2*cos(theta)*a*r+a^2+r^2)^(3/2)*((-2*cos(theta)*a*r+a^2+r^2)^(1/2)*(2*cos(theta)*a*r+a^2+r^2)^(1/2))^(1/2)*E)

(10)

``

# find the limiting case

Att := limit(Diff_ut*r*sin(2*theta), r = infinity);

(2*a*sigma*cos(theta)^3*sin(theta)^2*nu+2*a*sigma*cos(theta)*sin(theta)^4*nu+2*a*sigma*cos(theta)^3*sin(theta)^2+2*a*sigma*cos(theta)*sin(theta)^4-8*a*sigma*cos(theta)*sin(theta)^2*nu^2-6*a*sigma*cos(theta)*sin(theta)^2*nu+2*a*sigma*cos(theta)*sin(theta)^2)/(((cos(theta)^2+sin(theta)^2)/cos(theta)^2)^(1/2)*E)

(11)

Arr := limit(Diff_ur*r*(1-cos(2*theta)), r = infinity);

(-16*a*sigma*cos(theta)^6*nu^2-16*a*sigma*cos(theta)^4*sin(theta)^2*nu^2-6*a*sigma*cos(theta)^6*nu-6*a*sigma*cos(theta)^4*nu*sin(theta)^2+10*a*sigma*cos(theta)^6+10*a*sigma*sin(theta)^2*cos(theta)^4+28*a*sigma*cos(theta)^4*nu^2+20*a*sigma*cos(theta)^2*sin(theta)^2*nu^2+10*a*sigma*cos(theta)^4*nu+4*a*sigma*cos(theta)^2*sin(theta)^2*nu-18*a*sigma*cos(theta)^4-16*a*sigma*sin(theta)^2*cos(theta)^2-12*a*sigma*cos(theta)^2*nu^2-4*a*sigma*sin(theta)^2*nu^2-4*a*sigma*cos(theta)^2*nu+2*a*sigma*sin(theta)^2*nu+8*a*sigma*cos(theta)^2+6*a*sigma*sin(theta)^2)/(cos(theta)*((cos(theta)^2+sin(theta)^2)/cos(theta)^2)^(1/2)*E)

(12)

G := (1/8)*(int(Arr+Att, theta = 0 .. Pi/2))*sigma*4;

-(1/8)*Pi*a*sigma^2*(4*nu^2-nu-5)/E

(13)

simplify(G)

-(1/8)*Pi*a*sigma^2*(4*nu^2-nu-5)/E

(14)

 


Download Derivative_implicit_maplePrime.mw

 

Thanks,

Please Wait...