## 17907 Reputation

13 years, 194 days

## Re...

@vv  Thanks for the helpful comment. I tweaked the code a bit. Now it immediately returns the exact single solution.

## Proof is needed...

@Carl Love  You wrote "There are no real roots". If  fsolve  cannot find a real root, this does not mean that there are no real roots.

Example (in Maple 2018):

```fsolve(x^1000-1000^x-1, x=999..1001);
evalf(eval(x^1000-1000^x-1, x=999));
evalf(eval(x^1000-1000^x-1, x=1001));
```

fsolve(x^1000-1000^x-1, x, 999 .. 1001)
3.666954248*10^2999
-9.972830761*10^3002

## prefix notation...

@BennyMopps  Back quotes are used to get the prefix notation of a operator.

Examples:

````\$`(a,4);
a\$4;
`+`(a,b);
`*`(a,b,c);
```

## Re...

From help:  "The name  `if`  is an alias for  ifelse . When using this name,  if  must be enclosed in back quotes (left single quotes) because  if  is a Maple reserved word".

See help on   ifelse  for detailes.

## Interpretation...

@Preben Alsholm The correct answer to the question posed depends on the interpretation (positive or negative). I understood this question in the following sense: choose roots in front of which there is a plus sign. If OP meant any other meaning, then let he just clarify the question. For example, you can put the question like this: find the parameters values at which a given root takes a positive (negative) value.

## Re...

@AHSAN  Read carefully my answer where I explained the reason for the error in your worksheet. The derivative is needed to prove that the function strictly decreases for all  lambda>1 , which proves the uniqueness of the root . Pay attention to the last command  Student:-NumericalAnalysis:-Bisection , where at each step the segment for isolating the root is halved.

Below is an adjustment for your code. I chose the  [1,2]  interval, since at its ends the expression P takes on values of different signs:

```restart;
with(Student[NumericalAnalysis]):
P := (-216*sqrt(2)*lambda^2*(lambda-4/3)*arctan((1/2)*sqrt(6*lambda-2)*sqrt(2))-108*Pi*lambda^2*(lambda-4/3)*sqrt(2)+(-12*lambda+16)*(6*lambda-2)^(3/2)+(-40*lambda+32)*sqrt(6*lambda-2))/(576*lambda^2)+1/(6*lambda);
plot(P, lambda = 0 .. 2, size = [600, 250]);
FalsePosition(evalf(P), [1, 2], tolerance = 10^(-2));```

1.376882139

## Re...

You are using  alias  incorrectly. Should be

```restart;
alias(h=h(x), V=V(h(x)));
diff(V, x);
convert(%, diff);
```

## Automation...

@MDD  Here is a more automatic solution to your second example where  n  could be any positive integer, not necessary  n=3 :

```restart;
A:=[(a*x[1, 1] + E[1, 1])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 1] + E[2, 1])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 1] + E[3, 1])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 2] + E[1, 2])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 2] + E[2, 2])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 2] + E[3, 2])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 3] + E[1, 3])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 3] + E[2, 3])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 3] + E[3, 3])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 1] + E[1, 1])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 1] + E[2, 1])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 1] + E[3, 1])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 2] + E[1, 2])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 2] + E[2, 2])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 2] + E[3, 2])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 3] + E[1, 3])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 3] + E[2, 3])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 3] + E[3, 3])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 1] + E[1, 1])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 1] + E[2, 1])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 1] + E[3, 1])*(E[3, 3] + (a + 2)*x[3, 3]), (a*x[1, 2] + E[1, 2])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 2] + E[2, 2])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 2] + E[3, 2])*(E[3, 3] + (a + 2)*x[3, 3]), (a*x[1, 3] + E[1, 3])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 3] + E[2, 3])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 3] + E[3, 3])*(E[3, 3] + (a + 2)*x[3, 3])];
select(t->op(0,t)=E,indets(A,indexed));
n:=max(map(t->op(1,t), %));
S1:={seq(a*x[k, k]+E[k, k],k=1..n)};
S2:={seq(E[k, k]+(a+2)*x[k,k],k=1..n)};
subsindets(A, Or(seq([identical~(S1),identical~(S2)][], k=1..n)), t->`if`(t in S1,op(1,t)+1,-1+op(2,t)));
```

## A way...

```restart;
A:=[(a*x[1, 1] + E[1, 1])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 1] + E[2, 1])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 1] + E[3, 1])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 2] + E[1, 2])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 2] + E[2, 2])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 2] + E[3, 2])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 3] + E[1, 3])*(E[1, 1] + (a + 2)*x[1, 1]) + (a*x[2, 3] + E[2, 3])*(E[1, 2] + (a + 2)*x[1, 2]) + (a*x[3, 3] + E[3, 3])*(E[1, 3] + (a + 2)*x[1, 3]), (a*x[1, 1] + E[1, 1])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 1] + E[2, 1])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 1] + E[3, 1])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 2] + E[1, 2])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 2] + E[2, 2])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 2] + E[3, 2])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 3] + E[1, 3])*(E[2, 1] + (a + 2)*x[2, 1]) + (a*x[2, 3] + E[2, 3])*(E[2, 2] + (a + 2)*x[2, 2]) + (a*x[3, 3] + E[3, 3])*(E[2, 3] + (a + 2)*x[2, 3]), (a*x[1, 1] + E[1, 1])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 1] + E[2, 1])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 1] + E[3, 1])*(E[3, 3] + (a + 2)*x[3, 3]), (a*x[1, 2] + E[1, 2])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 2] + E[2, 2])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 2] + E[3, 2])*(E[3, 3] + (a + 2)*x[3, 3]), (a*x[1, 3] + E[1, 3])*(E[3, 1] + (a + 2)*x[3, 1]) + (a*x[2, 3] + E[2, 3])*(E[3, 2] + (a + 2)*x[3, 2]) + (a*x[3, 3] + E[3, 3])*(E[3, 3] + (a + 2)*x[3, 3])];

S1:={seq(a*x[k, k]+E[k, k], k=1..3)};
S2:={seq(E[k, k]+(a+2)*x[k,k], k=1..3)};

subsindets(A, Or(seq(identical~(S1), k=1..3),seq(identical~(S2), k=1..3)), t->`if`(t in S1,op(1,t)+1,-1+op(2,t)));
```

## Re...

@binbagsss  Yes of course. More accurately  D(V) (h(x)) = (dV/dh)(h(x))

## Re...

@achreftabet  I do not know that. Maybe someone here specializing in differential equations can answer your question.

## Solution for symbolic a, b, phi...

@JAMET The procedure  Ellipse  numerically solves the problem (it is convenient for plotting, etc.). If you want an explicit solution for symbolic parameters  a, b, phi  then the code below does it:

```restart;
Vdot := proc(U, V) add(U[i]*V[i], i = 1 .. 2) end proc:
dist := proc(M, N) sqrt(Vdot(M-N, M-N)) end proc:
c := sqrt(a^2-b^2):
F1 := [c, 0]: F2 := [-c, 0]:
M := [a*cos(t), b*sin(t)]:
MF2 := dist(M, F2):
MF1 := dist(M, F1):
varphi := arccos((MF1^2+MF2^2-4*c^2)/(2*MF1*MF2)):
Sol:=[solve(varphi=phi, t)] assuming a>0,b>0,a^2-b^2>0,phi>0:
t0:=simplify(arctan(op(1,Sol[5])/op(2,Sol[5]))) assuming a^2-b^2>0,sin(phi)>0;  # Value t for point M
simplify(eval(M,t=t0)) assuming a^2-b^2>0,sin(phi)>0,a^2*cos(phi)+a^2-2*b^2>0; # Coordinates of point M
simplify(eval(MF2,t=t0)) assuming a^2-b^2>0,sin(phi)>0,a^2*cos(phi)+a^2-2*b^2>0; # Distance from point M to focus F2
simplify(eval(MF1,t=t0)) assuming a^2-b^2>0,sin(phi)>0,a^2*cos(phi)+a^2-2*b^2>0; # Distance from point M to focus F1
```

## Re...

@JAMET  Look carefully at the example in my answer. The procedure returns the coordinates the point  M  as a list, as well as the distances of the point  M  from the focuses  F1  and  F2  MF1  and  MF2 )  for the specific parameters  a , b , phi .

## assuming real...

In fact, the found solution  sol  is true not only for positive, but also for all real values x . To acer's two methods, I added plotting. Of course this is not mathematically rigorous, but still convincing enough:

```restart;
ode:=diff(y(x),x)-y(x) = x*y(x)^(1/2):
ic:=y(0)=4:
sol:=dsolve([ode, ic],y(x));
check:=odetest(sol,ode);
simplify(eval(check,x=2*t)) assuming real; # The first way
simplify(simplify(check, {exp(x)=exp(x/2)^2})) assuming real;  # The second way
plot(check, x=-10..10, -1e-6..1e-6, axes=box, size=[1000,300]);  # The third way
```