## 17907 Reputation

13 years, 194 days

## ?...

@ruhamdam  I don't see an error:

```restart;
L:=proc(P,v)
if P=x then  x*y elif
P=y then  1 elif
P=z then  z^2 elif
nops(P)=1 and not (P in v) then  0 elif
type(P,`+`) then  map(L,P,v) elif
type(P,`*`) or type(P,`^`) then if type(P,`^`) then  op(2,P)*op(1,P)^(op(2,P)-1)*L(op(1,P),v)  else  `+`(seq(`*`(({op(P)} minus {p})[])*`if`(p::numeric,0,`if`(p in v,L(p,v),op(2,p)*op(1,p)^(op(2,p)-1)*L(op(1,p),v))),p={op(P)})) fi; fi;
end proc:

L(3+x,[x,y,z]);
L(3,[x,y,z]);
```

## The source of the problem...

ABCD  is a square and 2 angles  ECF  and  BCG  are known  (in degrees). Find angle  GFA  (see a pic. below).

It is easy to check that this angle is the original trigonometric expression. I know a very simple geometric solution (without Maple and without any trigonometry), but I will not show it for now, so that everyone can enjoy their own solution.

## Re...

@acer  We have to do this to get a solution, since Maple 2018 returns NULL for

```solve(csgn(ln(x+1)-2)=-1) assuming real;
```

## ln(x+1)...

@acer  Should be  x+1>0  (in real domain)

## Re...

@acer  Yes, I noticed your answer was updated after my comment was posted.

## Result in Maple 2018...

@acer  Thank you. In my Maple 2018.2  I get

`simplify(convert(Expr,exp));`

## Syntax...

For grouping expressions in Maple, only parentheses (not square brackets) are used. Square brackets are used when creating lists. Also I didn't understand what  `&ndash;`(0.3364722366, 1.2)  means.

## Thanks...

@nm  Thank you. Yes, Mathematica's capabilities are impressive.

## Re...

@nm  Please execute in Mathematica the code  Simplify[ f ]  or  FullSimplify[ f ] . Can it to simplify the expression  f  to the expression  g  without knowing  g ?

## The same method...

@Earl   Just replace  y  with  y(x)  and use the  d  procedure. All terms of the resulting equation have  dx  as a factor. We can reduce it, or we can do nothing - this does not affect the result:

```restart;
d:=z->diff(z,x)*dx:
DE:=y(x)*cos(x)*d(y(x))-sin(x)*dx;

dsolve(DE);
plot([seq(eval(y(x),%[1]),_C1=-3..3),seq(eval(y(x),%[2]),_C1=-3..3)], x=-Pi/2..Pi/2, scaling=constrained, size=[500,500], view=[-Pi/2..Pi/2,-2..2]);
```

## Pedagogical purpose...

@Carl Love I understand very well that my procedure can be improved both in terms of its effectiveness and length. But there are also pedagogical considerations. You can see for yourself that OP is a complete newbie to coding. My goal was to make minimal changes to the code to make it work and at the same time maintain the overall intent of the person who wrote the code. It is great that you are always looking for the best solutions. At the same time, I think it is not entirely ethical to speak out here about the vote.

## sorry...

@maxprog I beg your pardon. I do not have a maple calculator.

## ?...

What does  2 z y =  mean?

## Solution...

@nm  There are 2 problems with this example:
1. The  indets  command for some reason does not consider  sqrt  as a function.
2. Maple unusually returns the result if any real number is the solution. It just returns  x  instead of  RealRange(-infinity,infinity) .

The following code handles these situations:

```restart;
ode:=diff(y(x),x)-y(x) = x*y(x)^(1/2);
ic:=y(0)=4;

#this below code from https://www.mapleprimes.com/questions/231328-How-To-Make-Solve-Obtain-All-Values

sol:=dsolve([ode,ic],y(x));
res:=odetest(sol,ode);
F:=indets(res, function); # The function sqrt is missing
F:=F union indets(res,sqrt);
R:=[solve(`and`(seq(`or`(F[i]>0, F[i]<0, F[i]=0), i=1..nops(F))))];
if R=[x] then R:=[RealRange(-infinity,infinity)] fi;
solve(res) assuming `or`(seq(x in R[i],i=1..nops(R)));```

## Automation...

@nm  Take a look at the update to my answer above. This same way solves your last example:

```restart;
ode:=diff(y(x),x)=2*(x*sqrt(y(x))-1)*y(x):
ic:=y(0) = 1:
sol:=dsolve([ode,ic],y(x));
res:=odetest(sol,ode);
F:=indets(res, function);
R:=[solve(`and`(seq(`or`(F[i]>0, F[i]<0, F[i]=0), i=1..nops(F))))];
solve(res) assuming `or`(seq(x in R[i],i=1..nops(R)));
```

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