C_R

1960 Reputation

19 Badges

5 years, 280 days

MaplePrimes Activity


These are answers submitted by C_R

Most of the ways described can be performed syntax free with the context pannel

https://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet%2freference%2fcontextpanel

https://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet%2fexpressions%2fmanipulatecsm

combine(factor(expand(n*x^n - 2*n*x^(n - 1) + x^n)))

As an alternative to extracting and dissembling the RootOf expression with index=real[4] its possible in this case to substitute the solution for “a” (which comes with the RootOf expression for b) into the original expression expr

expr := 36*a^3*b^3+8*a^2*b^2*(9*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)+((a-b)^2-2*(a+b)+1)^2*(a+b+1)^5+a*b*((a-b)^2-2*(a+b)+1)*(17*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)^2

36*a^3*b^3+8*a^2*b^2*(9*(a+b+1)^2+4*a*b+4*a+4*b)*(a+b+1)+((a-b)^2-2*a-2*b+1)^2*(a+b+1)^5+a*b*((a-b)^2-2*a-2*b+1)*(17*(a+b+1)^2+4*a*b+4*a+4*b)*(a+b+1)^2

(1)

simplify(subs(a = sqrt(3)-1, 36*a^3*b^3+8*a^2*b^2*(9*(a+b+1)^2+4*a*b+4*a+4*b)*(a+b+1)+((a-b)^2-2*a-2*b+1)^2*(a+b+1)^5+a*b*((a-b)^2-2*a-2*b+1)*(17*(a+b+1)^2+4*a*b+4*a+4*b)*(a+b+1)^2))

((b^6+11*b^5-5*b^4-144*b^3+39*b^2+981*b+873)*3^(1/2)+b^7+2*b^6-18*b^5+4*b^4+251*b^3-66*b^2-1698*b-1512)*(b-1)^2

(2)

`assuming`([solve(((b^6+11*b^5-5*b^4-144*b^3+39*b^2+981*b+873)*3^(1/2)+b^7+2*b^6-18*b^5+4*b^4+251*b^3-66*b^2-1698*b-1512)*(b-1)^2, [b], useassumptions)], [b > 0])

[[b = 1]]

(3)

NULL

Download RootOf_index_real_solution_.mw

The condition all parameters are positive is not sufficient to decide on the sign of the roots since a[1] to a[3] can become negative or positive depending on the values of the parameters.

You have to provide relations between parameters (e.g. b>r) to determine ranges for a[1] to a[3] which then might enable you to determine ranges for the roots. Even then I have little hope that you will get a simple answer.

If I add a dot to expr=0  to the first command I get the same output.

solve({0 <~ (a, b), expr = 0.}, [a, b], allsolutions);
(solve(expr = 0., [a, b], useassumptions, allsolutions) assuming (0 <~ (a, b)));
solve({0 <~ (a, b), expr = 0.}, [a, b], allsolutions);

Edit:

In the attachment you can see for the exact solutions that

  • only two solutions are identical
  • the solution s2 is clearly different from all other solutions since there is no solution with a=sqrt(3)-1=0.73. It seems that the solutions with RootOf are not displayed.
  • I am not really an expert with RootOf expressions

I hope someone more experienced can have a look at it.

solve_RootOf.mw (updated after edit)

To what I can see with printlevel:=100 simplify calls simplify,size in both cases

value remembered (in simplify): \`simplify/do\`(a*f(x)+b*f(x)+a*g(x)+1/(a*f(x)+b*f(x)+a*g(x)), size) -> a*f(x)+b*f(x)+a*g(x)+1/((a+b)*f(x)+a*g(x))

For me it looks like that simplify,size could do better on such expressions.

For your example it is possible to execute a Maple command within Flow

convert(1000*Unit('Omega'), units, Unit('`k&Omega;`'))

To preserve the value one (i.e. "1") in front of kOhm

convert(evalf(1000*Unit('Omega')), units, Unit('`k&Omega;`'))

Supported prefixes can be found here.

If you execute

expr:=(c[2]+x)^3+a; 
printlevel:=100;  
simplify(expr)

you can see that simplify/size is called nummerous times but only after simplify/normal has been called which expands expr to
x^3+3*x^2*c[2]+3*x*c[2]^2+c[2]^3+a

Then simplify/size is applied

--> enter \`simplify/size\`, args = x^3+3*x^2*c[2]+3*x*c[2]^2+c[2]^3+a

So, simplify tries to reduce the size of the above expression but not of the original.

Expanding with the normal command at the toplevel of the simpify logic seems to be a design descision.

 

f(x) = 1+c__1*g(x)+c__2*g(x)^2

f(x) = 1+c__1*g(x)+c__2*g(x)^2

(1)

g(x) = A*B/x

g(x) = A*B/x

(2)

subs(g(x) = A*B/x, f(x) = 1+c__1*g(x)+c__2*g(x)^2)

f(x) = 1+c__1*A*B/x+c__2*A^2*B^2/x^2

(3)

diff(f(x) = 1+c__1*A*B/x+c__2*A^2*B^2/x^2, x)

diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3

(4)

subs(isolate(g(x) = A*B/x, A), diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3)

diff(f(x), x) = -c__1*g(x)/x-2*c__2*g(x)^2/x

(5)

algsubs((rhs = lhs)(g(x) = A*B/x), diff(f(x), x) = -c__1*A*B/x^2-2*c__2*A^2*B^2/x^3)

diff(f(x), x) = (-2*c__2*g(x)^2-c__1*g(x))/x

(6)

NULL


Update: As someone who has never mastered algsubs, all I can say is that (as I read the algsubs documentation) it should have worked.  Maybe someone else can say why swapping sides was needed to make it work. I would be interested to learn.

Update2: From the algsubs help page: 

The function algsubs performs an algebraic substitution, replacing occurrences of a with b in the expression f.

I.e. lhs is replaced with rhs.

Download with_and_wo_algsubs.mw

If working with equations instead of assignments to names g and f is an option you could do

g(x) = 1+c__1/x+c__2/x^2+c__3/x^3

g(x) = 1+c__1/x+c__2/x^2+c__3/x^3

(1)

f(x) = 1-1/g(x)

f(x) = 1-1/g(x)

(2)

diff(f(x) = 1-1/g(x), x)

diff(f(x), x) = (diff(g(x), x))/g(x)^2

(3)

diff(g(x) = 1+c__1/x+c__2/x^2+c__3/x^3, x)

diff(g(x), x) = -c__1/x^2-2*c__2/x^3-3*c__3/x^4

(4)

subs(diff(g(x), x) = -c__1/x^2-2*c__2/x^3-3*c__3/x^4, diff(f(x), x) = (diff(g(x), x))/g(x)^2)

diff(f(x), x) = (-c__1/x^2-2*c__2/x^3-3*c__3/x^4)/g(x)^2

(5)

NULL

Download with_eqn.mw

You could insert a table like in the attached where the borders are set to none and the width of the first row sets the indent

NULL

 

``

• 

My text

NULL

• 

 

NULL

• 

 

 

 

` `

Download Bullet.mw

I assume that "simplify" without options on this complex expression has too many cases to be examined by the underling algorithm.

Try alternatively

simplify(exprB, exp)

 

The intersection of the two expressions is a surface
 

plot3d(1/5*b^2 - 1/5*b*x - 1/5*x^2, b = -4 .. 4, x = -4 .. 4)

intersectplot plots "intersection of 2 surfaces in 3-D" which is a curve

Try this

plot3d([b, b^2/4, -b/2], b = -4 .. 4, thickness = 5, color = red, style = line)
First 6 7 8 9 10 Page 8 of 10