## 20254 Reputation

15 years, 338 days

## D operator, unapply command , continuou...

 > restart;
 > f := x->a*x/(4*x^2+b); g:=D(f);
 (1)
 > h:=unapply(int(f(t),  t=0..x, continuous), x); h(x);
 (2)
 >

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 >

## eval...

The  simplify  command is redundant here and can be dispensed with using the  eval command:

```restart;
diff(f(x,y),x)+diff(f(x,y),y);
eval(%, f(x,y)=f(x,y0));
```

## convert(... , exp)...

In older versions of Maple, the  simplify  command does not help (I'm using Maple 2018). The  convert  command does the job:

```Expr:=sin(theta)^(A - 2)*cos(theta)^2 - sin(theta)^(A - 2) + sin(theta)^A:
convert(Expr, exp);
```

0

## In one go in Maple 2018...

```restart;
eqn := y(x)*(2*x*(diff(y(x), x))+y(x)*((diff(y(x), x))^2-1)) = -1:
dsolve(eqn);```

## Solution...

You can easily solve this system numerically if you give numerical values for the parameters alpha, a[1], a[2], a[3] .

The example:

 > restart; eq1 := diff(f(x), x, x, x)+(1/2)*cos(alpha)*x*(diff(f(x), x, x))+(1/2)*sin(alpha)*f(x)*(diff(f(x), x, x)) = 0: eq2 := diff(g(x), x, x)+diff(g(x), x)+(diff(g(x), x))*(diff(h(x), x))+cos(alpha)*x*(diff(g(x), x))+sin(alpha)*f(x)*g(x) = 0: eq3 := diff(g(x), x, x)+diff(h(x), x, x)+1/2*(cos(alpha)*x+sin(alpha)*f(x)) = 0: ics := f(0) = 0, (D(f))(0) = 1, ((D@@2)(f))(0) = a[1], g(0) = 1, (D(g))(0) = a[2], h(0) = 1, (D(h))(0) = a[3]: alpha:=Pi/4: a:=[1,2,3]: dsolve({eq1,eq2,eq3,ics}, numeric); plots:-odeplot(%, [[x,f(x)],[x,g(x)],[x,h(x)]], x=0..3, color=[red,blue,green]);
 >

## A way...

Suppose you want to write the following expression  Expr  in powers of  x-1 . You can do it like this:

 > restart; Expr:=x^2-3*x+5: eval(Expr, x=y+1); subs(y=``(x-1),expand(%)); # Desired form expand(%); # Check
 (1)
 >

## Solution...

Since the curve  f(x)  is symmetrical about the Oy axis, the circle must also be symmetrical about the Oy axis and touch the lower branch in the point  (0,-1) . So the upper semicircle will be  y=sqrt(R^2-x^2)+R-1 . In general, we have 5 points of intersection. If we impose the condition  R^2-2*R = 0 , then we have 3 points of intersection:

 > restart; solve(sqrt(R^2-x^2)+R-1=(x^2+1)/(x^2-1), x); R:=solve(R^2-2*R=0)[2]; plots:-display(plot((x^2+1)/(x^2-1), x=-4..4, -4..4, color=blue), plots:-implicitplot(x^2+(y-(R-1))^2=R^2, x=-4..4, y=-4..4, color=red));
 >

 >
 (1)
 >
 (2)
 >
 >
 (3)
 >

## A way...

```restart;
i := [seq(2*i-1, i = 1 .. 10)];
A[m]:=[seq((x/a)^(i+1)*(1-x/a)^2, i in i)];
```

## A way...

I think OP meant the intersection not of the surfaces of these tori, but of the solids themselves. Here is a way:

```restart;
with(plots):
ce := (p, q, r, a, b) ->  ((x-p)^2 + (y-q)^2 + (z-r)^2 + a^2 - b^2)^2 - 4*a^2*((x-p)^2 + (y-q)^2):
T1 := ce(1, 1, 1, 2, 1):
T2 := ce(1, 6, 1, 2, 1):
implicitplot3d(max(T1,T2), x=-1..3, y=0..4.5, z=-1..2, style=surface, color="Red", grid=[50, 50, 50], scaling=constrained, axes=normal, orientation=[15,80]);
```

## RandomTools:-Generate(choose({ ... }));...

Example:

`RandomTools:-Generate(choose({x->x^2,x->x^3,x->x^4}));`

## Inequality with a parameter...

You are actually solving the inequality with a parameter ( t1 is a parameter). I don't know about the latest versions, but Maple 2018 does not support this, an error message appears:

```restart;
solve((4*t1+4*sqrt(t1^2-4*t2))>0,t2, allsolutions, parametric=true);```

Error, (in solve) invalid input: SolveTools:-SemiAlgebraic expects its 1st argument, osys, to be of      type ({list, set})({ratpoly(rational), ratpoly(rational) = ratpoly(rational), ratpoly(rational) <> ratpoly(rational), ratpoly(rational) <= ratpoly(rational), ratpoly(rational) < ratpoly(rational)}), but received {0 < 4*t1+4*(t1^2-4*t2)^(1/2)}

## Solution...

The problem is solved with good accuracy by reducing to a system of 4 equations with 4 unknowns:

 > restart; f:=(x1,x2)->4*(x1-0.25)^4-x1^2*x2^2+(x2-0.25)^4-1.21: P:=plots:-implicitplot(f, -2..2, -2..2, color=blue, scaling=constrained): S:=[seq([x0,y0]+~d*~[cos(t+Pi/2*k),sin(t+Pi/2*k)], k=0..3)]; fsolve({seq(f(S[i][]), i=1..4)}, {x0=-2..2,y0=-2..2,t=0..2*Pi,d=0..2}); S:=eval(S, %); plots:-display(P, plottools:-polygon(S, style=line, color=red)); Dist:=(X,Y)->sqrt((X[1]-Y[1])^2+(X[2]-Y[2])^2): seq(Dist(S[i],S[i+1]), i=1..3),Dist(S[1],S[4]); # Side lengths of the square
 (1)
 >

## convert...

I do not see any problems in this to waste my time on such manipulations. If anyone likes one form, then he can easily switch to it using the  convert  command.

Examples:

```restart;
convert(sec(x), sincos);
convert(csc(x), sincos);
convert(tan(x), sincos);
convert(sin(x)/cos(x), tan);
```

 4 5 6 7 8 9 10 Last Page 6 of 281
﻿