## 7930 Reputation

11 years, 73 days

## MaplePrimes Activity

### These are answers submitted by nm

Need to tell it from where you are approaching 0

`limit( log(x)/x,x=0,right)`

```restart;
lst:={la, ra, rb, t, t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9, xa, za}:

select(X->`if`(String(X)[1]="t" and type(parse(String(X)[2..-1]),integer),true,false),lst)```

gives

{t10, t11, t12, t13, t15, t17, t18, t19, t21, t23, t24, t25, t26, t27, t28, t31, t32, t33, t34, t35, t36, t37, t39, t41, t42, t43, t44, t45, t46, t48, t49, t5, t50, t52, t53, t54, t55, t56, t57, t58, t59, t61, t62, t63, t64, t65, t67, t68, t69, t7, t70, t9}

There are many ways,. Here are two

 > restart;
 > ode:=diff(y(x),x\$2)+diff(y(x),x)+y(x)=0; sol:=dsolve(ode);

 > diff(rhs(sol),x)

 > sol := unapply(rhs(sol),x);

 > diff(sol(x),x)

 > diff(sol(x),x\$2)

 >

You can also make y(x) itself a function. But I think it is better to use sol and keep y as free variable.

 > restart;
 > ode:=diff(y(x),x\$2)+diff(y(x),x)+y(x)=0; sol:=dsolve(ode);

 > y := unapply(rhs(sol),x); diff(y(x),x)

 >

looks like numerical issue. Try

```restart;
sol:=[solve((20 + 20*T + 2*T*(T + 1))*exp(-T) - 10*exp(-2*T) - 2*T - 10 = 0,T)];
evalf~(sol)
```

Gives

[-10.0000000000, -0.0000000000]

PDEtools gives just zero as answer

```restart;
sol:=PDEtools:-Solve((20 + 20*T + 2*T*(T + 1))*exp(-T) - 10*exp(-2*T) - 2*T - 10 = 0,T);
evalf(sol)
```

This is hard to solve exactly, so use root finder

```restart;
eq:=(20 + 20*T + 2*T*(T + 1))*exp(-T) - 10*exp(-2*T) - 2*T - 10 = 0;
Student:-Calculus1:-Roots(eq, 0..2);

```

[0, 1.4114548230]

Maple 2022.1 on windows 10.

Try to see if this works for you.   Maple 2022.1

```restart;
with(Statistics):
with(stats):
y_a:=t->piecewise(0<=t and t<=1,DynamicSystems:-Sine(1.5*t,10*Pi,0,0),1<=t and t<=2,DynamicSystems:-Sine(1.5*(2-t),10*Pi,0,0));
plot(y_a(t),t=0..2);
mu:=t->statevalf[pdf,normald[1,2*4.47]](t);
plot(mu(t),t=0..2);
y:=t->y_a(t)+mu(t);
plot(y(t),t=0..2)
```

type

`ssystem("powershell.exe get-process")`

 > restart;
 > ode:=diff(y(x),x\$2)+ 4*diff(y(x),x) + 4*y(x) = sin(x); ic:=y(0) = 1 , D(y)(0)=0; sol_analytic:=dsolve([ode,ic]); sol_numeric:=dsolve([ode,ic], numeric, method = gear,output=listprocedure): sol_numeric := eval(y(x),sol_numeric):

 > p1:=plot(rhs(sol_analytic),x=0..10,title="analytic",gridlines,color=blue):
 > p2:=plot(sol_numeric(x),x=0..10,title="numerical",gridlines,color=red):
 > [p1,p2]

 >

feel free to make improvements as needed

```restart;
y := x-> a*x^3 + b*x^2 + c*x + d:
pts:=[[-1,-4],[1,0],[2,0],[3,-4]]:
eqs:=[seq(y(pts[i,1])=pts[i,2],i=1..numelems(pts))];
sol:=solve(eqs,{a,b,c,d}):
equation_of_curve:=eval(y(x),sol);
plots:-display(plot(equation_of_curve,x=-4..4,gridlines),plots:-pointplot(pts,color=blue,symbol=solidcircle,symbolsize=20))
```

pick say x=-1, then your function becomes   (-1)^(1/3). But -1=exp(I*Pi). Hence (-1)^(1/3) is the same as exp(I*Pi/3). Using Euler's formula, this is the same as  cos(Pi/3)+I*sin(Pi/3) = 0.5 + 0.8660254037*I   which is complex.

That is why Maple does not plot for for negative x.

may ways to do this. One is to use zip. But they have to be lists not sets. You can convert them

```s1:=[a, b, c];
s2:=[a, b, d];
```

2*a + 2*b + c + d

Or use shorthand

```add(zip(`+`,s1,s2))
```

2*a + 2*b + c + d

Under Options->General. Uncheck it

try expanding it first so both sides have same structure?    evalb(a-a*b=expand(a*(1-b)))  now gives true.

Help says

The evalb command does not simplify expressions. It may return false for a relation that is true. In such a case, apply a simplification to the relation before using evalb.

In this case simplify() did not make it give true.

or you could just use is(a-a*b=a*(1-b)) gives true without the need to expand or simplify.

You can try adding some assumptions? for example

 > expr:=sqrt(y^2/(x^2+y^2))*sqrt(x^2+y^2)

 > simplify(expr)

 > simplify(expr) assuming x::real,y::real

 > simplify(expr) assuming x::real,y::real,y>0

 >

This works for me.

```restart;
f := 9*x^3 - 7*x^2*y + 8*x*y^2 - 6*y^3 + 3*x^2 - 3*x*y + 4*y^2 - 3*x + 9*y - 7;
fx:=diff(f,x);
fy:= diff(f,y);

ctpts:= solve({fx=0,fy=0},{x,y});
evalf(allvalues(ctpts))```

{x = 0.04295586238 + 0.2689937615*I, y = 0.9924517251 + 0.1221355623*I}, {x = -0.1196978953, y = -0.5678259706}, {x = -0.2777747003, y = -0.6265224321}, {x = 0.04295586238 - 0.2689937615*I, y = 0.9924517251 - 0.1221355623*I}

I do not know how to add rules to the build in simplify command in Maple (It is possible to do this in Mathematica easily). May there is a way to do it in Maple in order to teach it a new "rule".  The standard simplify(expr,ln) did not do it.

For now you can do

```expr:=(ln(-z*I + b) - ln(z*I + b));
I*simplify(log(exp(expr)))```

 1 2 3 4 5 6 7 Last Page 2 of 14
﻿