HI
Sorry in advance for this question rather basic pythonic than SageMath. I would like to split display of f(x) to appear on more than one line of code, to be more readable. I have been trying without success for half an hour ;-(
(surely I'm gonna loose lot of karma points with this question !)
var('x')
f(x)=1/2*x^2*arcsin(x*sin(1/9*pi)/(sqrt(-x^2 + 1)*cos(1/9*pi)))-1/2*x^2*arcsin(1/2*sqrt(-3*x^2 + 3)/sqrt(-x^2 + 1))- 1/2*sqrt(-x^2 - x^2*sin(1/9*pi)^2/cos(1/9*pi)^2 + 1)*x*sin(1/9*pi)/cos(1/9*pi)+ 1/4*sqrt(-1/4*x^2 + 1/4)*sqrt(-3*x^2 + 3)- 1/2*arcsin(x*sin(1/9*pi)/(sqrt(-x^2 + 1)*cos(1/9*pi)))+ 1/2*arcsin(1/2*sqrt(-3*x^2 + 3)/sqrt(-x^2 + 1))
#f(x)=1/2*x^2*arcsin(x*sin(1/9*pi)/(sqrt(-x^2 + 1)*cos(1/9*pi)))-
#1/2*x^2*arcsin(1/2*sqrt(-3*x^2 + 3)/sqrt(-x^2 + 1))-
#1/2*sqrt(-x^2 - x^2*sin(1/9*pi)^2/cos(1/9*pi)^2 + 1)*x*sin(1/9*pi)/cos(1/9*pi)+
#1/4*sqrt(-1/4*x^2 + 1/4)*sqrt(-3*x^2 + 3)-
#1/2*arcsin(x*sin(1/9*pi)/(sqrt(-x^2 + 1)*cos(1/9*pi)))+
#1/2*arcsin(1/2*sqrt(-3*x^2 + 3)/sqrt(-x^2 + 1))
#f(x)=1/2*x^2*arcsin(x*sin(1/9*pi)/(sqrt(-x^2 + 1)*cos(1/9*pi)))
#- 1/2*x^2*arcsin(1/2*sqrt(-3*x^2 + 3)/sqrt(-x^2 + 1))
#- 1/2*sqrt(-x^2 - x^2*sin(1/9*pi)^2/cos(1/9*pi)^2 + 1)*x*sin(1/9*pi)/cos(1/9*pi)
#+ 1/4*sqrt(-1/4*x^2 + 1/4)*sqrt(-3*x^2 + 3)
#- 1/2*arcsin(x*sin(1/9*pi)/(sqrt(-x^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1/18*pi)^2 - 2*tan(1/18*pi)^2 + sqrt(2) + 2)*tan(1/18*pi)^2 + 2*tan(1/18*pi)^2 + 2*sqrt(2)*sqrt(sqrt(2)*tan(1/18*pi)^4 + 2*tan(1/18*pi)^4 - 2*sqrt(2)*tan(1/18*pi)^2 - 2*tan(1/18*pi)^2 + sqrt(2) + 2) - 2*sqrt(2) - 4*sqrt(sqrt(2)*tan(1/18*pi)^4 + 2*tan(1/18*pi)^4 - 2*sqrt(2)*tan(1/18*pi)^2 - 2*tan(1/18*pi)^2 + sqrt(2) + 2) + 5)/((tan(1/18*pi)^2 + 1)*sqrt(-2*sqrt(2) + 3))))^2 + 1)*sqrt(-sqrt(2) + 2)
yUp=cos(2*arctan(1/4*sqrt(2)*sqrt(3*tan(1/18*pi)^4 + 2*tan(1/18*pi)^2 - sqrt(9*tan(1/18*pi)^8 + 12*tan(1/18*pi)^6 - 42*tan(1/18*pi)^4 + 12*tan(1/18*pi)^2 + 9) + 3)/tan(1/18*pi)))
intZXYAboveFirstTrianglePiece1=numerical_integral(f,yLow,yUp, max_points=100)
show("numerical integration : ",intZXYAboveFirstTrianglePiece1)
expression1=f
operandsList=[]
def print_tree(expr,k=5):
op = expr.operator()
operands = expr.operands()
if op:
#print k*' ---',op, operands
k += 1
for operand in operands:
#print_tree(operand,k)
operandsList.append(operand)
print_tree(expression1)
#show(operandsList)
index=0
for o in operandsList :
show("i :\t",index," :\t"," :\t",o)
index+=1
plt=plot(f,(x,yLow,yUp))
#show(plt,xmin=yLow,xmax=yUp,ymin=-0.8,ymax=0.8)
for o in operandsList :
plt+=plot(o,(x,yLow,yUp),color='grey',linestyle='dashed')
show(plt,xmin=yLow,xmax=yUp,ymin=-0.8,ymax=0.8)