read(`fenchel.m`); # Example 1. f1 := convert(abs(x),cf); subdiff(f1); g1 := conj(f1,y); # Example TWO f2 := convert(exp(x),cf); g2 := conj(f2,y); conj(g2,x); # Example THREE f3 := cf([[-infinity,1/2*(x^2-4*x+3),1], [1,0,1],[1,-ln(x),infinity]],x); g3 := conj(f3,y); # Example FOUR convert(b*x+c,cf,x); conj(",y); assume(a>0); convert(a*x^2+b*x+c,cf,x); conj(",y); # Example FIVE f5 := convert(ln((1/2)*(2^x+(2/3)^x)),cf); g5 := conj(",y): # conjugate is big cfeval(g5,y=1/2*ln(4/3)); temp := op([1,3,2],g5): ybar := fsolve(temp=y,y); # Example SIX f6 := cf([[-infinity,exp(-4*x-2),-1/2], [-1/2,1,-1/2], [-1/2,-x/(1+x),infinity]],x); factor(conj(f6,y)); # Example SEVEN f7 := convert(piecewise(x>=0, a*x+x^2,0),cf,x); g7 := factor(conj(f7,y)); # Example EIGHT f8 := convert(piecewise( -3<=x and x<=1, abs(x)-2*sqrt(1-x), infinity),cf); cfplot(f8,x=-4..2,scaling=constrained, axes=framed); sdf8 := subdiff(f8); sdplot(sdf8,x=-3..1,view=[-3..1,-3..5], axes=none); g8 := conj(f8,y); cfplot(g8,y=-3..3,scaling=constrained); simplify(convpw(g8)); # Example NINE f1; f9 := convert(1/2*x^2,cf); simplify(conj(f1,y) + conj(f9,y)); conj(",x); #Example TEN f10 := convert(1/3*abs(x)^3,cf); g10 := conj(f10,y);