Algebraic Expressions and Operations: Factoring Algebraic Fractions
MATLAB handles all calculations involving simple, rational, and complex algebraic expressions with mastery. It quickly and efficiently performs the operations of simplification, factorization, grouping, and expansion of algebraic expressions, no matter how complicated, including trigonometric expressions and expressions involving complex variables. All of this is possible provided the symbolic math Toolbox is available. The following is a list of commands which implement the algebraic transformations most commonly used in work with MATLAB.
2-1. Expansion of Algebraic Expressions
The following commands enable MATLAB to expand or develop algebraic expressions:
Now let’s look at several examples of algebraic manipulations using the commands we’ve just seen:
>> syms x y z t a b
>> pretty(expand((x+1)*(x+2)))
2
x + 3 x + 2
>> pretty(expand((x+1)/(x+2)))
x 1
------ + -------
x + 2 x + 2
>> pretty (expand (sin (x + y)))
sin(x) cos(y) + cos(x) sin(y)
>> pretty(expand(cos(2*x)))
2
2 cos(x) - 1
>> pretty(expand(exp(a+log(b))))
exp(a) b
>> pretty(expand(log(x/(1-x)^2)))
log(x) - 2 log(1 - x)
>> pretty(expand((x+1)*(y+z)))
x y + x z + y + z
>> pretty(expand(BesselJ(2,t)))
besselJ(1, t)
2 ------------------ - besselJ(0, t)
t
>> maple('expandoff(exp):expand(exp(a+b))')
ans =
exp(a+b)
>> maple('expandon(exp):expand(exp(c+d))')
ans =
exp(c)*exp(d)
EXERCISE 2-1
Find the greatest common divisor of the following algebraic expressions a and b:
a = sin2(x) + 2 sin(x) + 1, b = sin(x) + 1
First, we try to solve the problem directly.
>> syms a b x
>> maple ('a: = sin (x) ^ 2 + 2 * sin (x) + 1, b: = sin(x) + 1:gcd(a,b)')
Error, (in gcd) arguments must be polynomials over the rationals.
To avoid this error, use the command frontend as follows:
>> maple('frontend(gcd,[a,b])')
ans =
sin (x) + 1
EXERCISE 2-2
Expand the polynomial (x+2)2(x-2) as much as possible modulo 3. Also expand the polynomial (x +α)2(x -α) where α = RootOf (x2- 2). At the same time, expand the polynomial (x +β)2(x -β) modulo 2 where β = RootOf (x2+x+1).
>> pretty(sym(maple('expand( (x+2)^2*(x-2) ) mod 3')))
3 2
x + 2 x + 2 x + 1
>> pretty(sym(maple('alias(a=RootOf(x^2-2)):evala(Expand( (x+a)^2*(x-a) ))')))
3 2
x + a x - 2 x - 2 a
>> pretty(sym(maple('alias(b=RootOf(x^2+x+1)):evala(Expand( (x+b)^2*(x-b) ) mod 2)')))
3 2
x + x + b x + b x + 1
The command alias is used to define abbreviations for objects, which helps to reduce the complexity of the output.
2-2. Factoring Expressions over Fields and their Algebraic Extensions
The following commands enable Maple to factorize algebraic expressions, whether univariate, multivariate, over the field of real numbers or over the field of their coefficients or algebraic extensions thereof. The command syntax is as follows:
Here are some examples:
>> syms x y
>> pretty(factor(6*x^2+18*x-24))
6 (x + 4) (x - 1)
In the following example we simplify the numerator and denominator of an algebraic fraction, cancelling common factors:
>> pretty (factor ((x^3-y^3) /(x^4-y^4)))
2 2
x + y x + y
---------------------
2 2
(x + y) (x + y )
The following examples show factorizations of expressions over field extensions defined by the coefficients of the expression and the element(s) given in the second argument:
>> pretty(sym(maple('factor(x^3+5, 5^(1/3))')))
2 1/3 2/3 1/3
(x - 5 x + 5 ) (x + 5 )
>> pretty(sym(maple('factor(x^3+5, {5^(1/3),(-3)^(1/2)})')))
1/3 1/2 1/3 1/3 1/2 1/3 1/3
1/4 (2 x - 5 - (-3) 5 ) (2 x - 5 + (-3) 5 ) (x + 5 )
>> pretty(sym(maple('factor(y^4-2,sqrt(2))')))
2 1/2 2 1/2
(y + 2 ) (y - 2 )
>> pretty (sym (maple ('factor (y^ 4-2, RootOf(x^2-2))')))
2 2 2 2
(y + RootOf(_Z - 2)) (y - RootOf(_Z - 2))
The following example highlights the difference between factoring a polynomial expression over the field defined by its coefficients and the extension of this field by (- 3) ^(1/2):
>> pretty (factor(x^3+y^3))
2 2
(x + y) (x - x y + y )
>> pretty(sym(maple('factor(x^3+y^3,(-3)^(1/2))')))
1/2 1/2
1/4 (2 x - y - (-3) y) (2 x - y + (-3) y) (x + y)
>> pretty (sym (maple ('factor(x^3+5,complex)')))
(x + 1.7099759466766969893531088725439). (x - .85498797333834849467655443627193
+ 1.4808826096823642385229974586353 +i)
(x -.85498797333834849467655443627193 - 1.4808826096823642385229974586353 i)
In the following examples we perform factorizations using factors. This command returns the factors together with their multiplicities.
>> maple('readlib(factors)'),
>> pretty(sym(maple('factors( 3*x^2+6*x+3 )')))
[3, [[x + 1, 2]]]
>> pretty(sym(maple('Digits:=10:factors( x^4-4.0 )')))
2
[1.,[[x+1.414213562, 1], [x-1.414213562, 1], [x +1.999999999, 1]]]
>> pretty(sym(maple(factors( x^4-4.0,complex)')))
[1., [[x + 1.414213562, 1], [x + 1.414213562 i, 1], [x - 1.414213562 i, 1],
[x - 1.414213562, 1]]]
The following are examples of the inert and complete factorization commands Factor, Factors, AFactor, AFactors, split and Berlekamp.
>> pretty(sym(maple('Factor(x^2+3*x+3) mod 7')))
(x + 6) (x + 4)
>> pretty(sym(maple('alias(sqrt2=RootOf(x^2-2)):evala(Factor(x^2-2,sqrt2))')))
(x + sqrt2) (x - sqrt2)
>> pretty(sym(maple('evala(Factor(x^2-2*y^2,sqrt2))')))
(x - sqrt2 y) (x + sqrt2 y)
>> pretty(sym(maple('expand((x^3+y^5+2)*(x*y^2+3)) mod 7')))
4 2 3 7 5 2
x y + 3 x + y x + 3 y + 2 x y + 6
>> pretty (sym (maple ('Factor ('') mod 7')))
3 5 2
(x + y + 2) (x y + 3)
>> pretty(sym(maple('Factors(2*x^2+6*x+6) mod 7')))
[2, [[x + 4, 1], [x + 6, 1]]]
>> pretty(sym(maple('Factors(x^5+1) mod 2')))
4 3 2
[1, [[x + 1, 1], [x + x + x + x + 1, 1]]]
>> pretty(sym(maple('evala(Factors(2*x^2-1,sqrt2))')))
[2, [[x + 1/2 sqrt2, 1], [x - 1/2 sqrt2, 1]]]
>> pretty(sym(maple('alias(sqrtx=RootOf(y^2-x,y)):evala(Factors(x*y^2-1,sqrtx))')))
sqrtx sqrtx
[x, [[y + -----, 1], [- ----- + y, 1]]]
x x
>> pretty (sym (maple ('grading (AFactor(x^2-2*y^2))')))
(x sqrt2 y) (x + sqrt2 y)
>> pretty (sym (maple ('grading (AFactors(x^2-2*y^2))')))
[1, [[x - sqrt2 y, 1], [x + sqrt2 y, 1]]]
The following are examples of complete and Berlekamp factorizations.
>> pretty(sym(maple('readlib(split):split(x^2+x+1,x)')))
2 2
(x - RootOf(_Z + _Z + 1)) (x + 1 + RootOf(_Z + _Z + 1))
>> pretty(sym(maple('split(x^2+y*x+1+y^2, x, b)')))
2 2 2 2
(x - RootOf(_Z +y _Z + 1 + y ))(x + y + RootOf(_Z + y _Z + 1 + y ))
>> pretty(sym(maple('b')))
2 2
{RootOf(_Z + y _Z + 1 + y )}
>> pretty(sym(maple('p:= 10^10-33:Berlekamp(x^4+2,x) mod p')))
2 2
{x + 6972444635 x + 9284865757, x + 3027555332 x + 9284865757}
EXERCISE 2-3
Factorize the polynomial x3 + 5 in the algebraic extension defined by 51/3 and the algebraic extension defined by {51/3, √-3}. Also perform the complete factorization.
>> pretty(sym(maple('factor(x ^ 3 + 5, 5 ^(1/3))')))
2 1/3 2/3 1/3
(x - 5 x + 5 ) (x + 5 )
>> pretty(sym(maple('factor(x^3+5, {5^(1/3),(-3)^(1/2)})')))
1/3 1/2 1/3 1/3 1/2 1/3 1/3
1/4 (2 x - 5 + i 3 5 ) (2 x - 5 - i 3 5 ) (x + 5 )
>> pretty(sym(maple('readlib(split):split(x^3+5,x)')))
2 3 3 2
(x - RootOf(_Z + RootOf(_Z + 5) _Z + RootOf(_Z + 5) ))
3 2 3 3 2
(x + RootOf(_Z + 5) + RootOf(_Z + RootOf(_Z + 5) _Z + RootOf(_Z + 5) ))
3
(x - RootOf(_Z + 5))
EXERCISE 2-4
Find the factors and their multiplicities for the polynomial x4 - 4 over the real numbers, complex numbers, the algebraic extension defined by √2, the algebraic extension defined by {√2,i}, the algebraic extension defined by α = RootOf(x2-2), the algebraic extension defined by β = RootOf (x2+ 2), and the algebraic extension defined by {α, β }.
>> pretty(sym(maple('readlib(factors):factors( x^4-4 )')))
2 2
[1, [[x - 2, 1], [x + 2, 1]]]
>> pretty(sym(maple('readlib(factors):factors( x^4-4, complex)')))
[1, [[x + 1.414213562 i, 1], [x + 1.414213562, 1],
[x - 1.414213562 i, 1], [x - 1.414213562, 1]]]
>> pretty(sym(maple('readlib(factors):factors( x^4-4, sqrt(2) )')))
1/2 1/2 2
[1, [[x - 2 , 1], [x + 2 , 1], [x + 2, 1]]]
>> pretty(sym(maple('readlib(factors):factors( x^4-4, {sqrt(2), i } )')))
1/2 1/2 1/2 1/2
[1, [[x - i 2 , 1], [x + i 2 , 1], [x - 2 , 1], [x + 2 , 1]]]
>> pretty(sym(maple('readlib(factors):alias(a=RootOf(x^2-2)): alias(b=RootOf(x^2+2)):factors( x^4-4, a )')))
2
[1, [[x - a, 1], [x + a, 1], [x + 2, 1]]]
>> pretty(sym(maple('readlib(factors):factors( x^4-4, b )')))
2
[1, [[x + b, 1], [x - b, 1], [x - 2, 1]]]
>> pretty(sym(maple('readlib(factors):factors( x^4-4, {a,b} )')))
[1, [[x + b, 1], [x - a, 1], [x + a, 1], [x - b, 1]]]
EXERCISE 2-5
Let α = RootOf(x2 + x + 1) and β = RootOf(y2 - x, y). Factorize modulo 2 the univariate polynomial x3 + 1 over the algebraic extension defined by α . Factorize modulo 5 the bivariate polynomial x2+ 2xy + y2 + 1 + x + y over the algebraic extension defined by α . Factorize modulo 5 the following bivariate polynomial: x2y + xy2 + 2αxy + α2 + 4xαx + y +α. Find the factors and their multiplicities modulo 5 for the bivariate polynomial x2y + xy2 + 2αxy +α2+ 4 xαx + y +α. Find the factors and their multiplicities modulo 2 for the univariate polynomial x5 + 1 over the algebraic extension defined by α . Factorize the bivariate polynomial xy2 - 1 over the algebraic extension defined by β .
>> pretty(sym(maple('alias(a=RootOf(x^2+x+1)):Factor(x^3+1,a) mod 2')))
(x + a + 1) (x + 1) (x + a)
>> pretty (sym (maple ('Factor(x^2+2*x*y+y^2+1+x+y,a) mod 5')))
(y + x + 4) (y + x + a + 1)
>> pretty (sym (maple ('Factor(x^2*y+x*y^2+2*a*x*y+a*x^2+4*a*x+y+a) mod 5')))
(x y + x + 1) (y + x + a)
>> pretty (sym (maple ('Factors(x^2*y+x*y^2+2*a*x*y+a*x^2+4*a*x+y+a) mod 5')))
[1, [[x y + x + 1, 1], [y + x + a, 1]]]
>> pretty (sym (maple ('Factors(x^5+1,a) mod 2')))
2 2
[1, [[x + 1, 1], [x + (a + 1) x + 1, 1], [x + x + 1, 1]]]
>> pretty (sym (maple ('alias (b = RootOf(y^2-x,y)):evala(Factor(x*y^2-1,b))'))))))
x (y - b/x) (b/x + y)
EXERCISE 2-6
Let p = x6 + x5 + x4 + x3 + 2x2 + 2 x + 1. Find the Berlekamp factorization of p modulo 2. Also factorize the bivariate algebraic expression x4y2 + 3x3+ y7x +3y5 + 2xy2 + 6 over the field defined by its coefficients.
>> pretty(sym(maple('p:=x^6+x^5+x^4+x^3+2*x^2+2*x+1:Berlekamp(p,x) mod 2')))
4 2
{x + x + 1, x + x + 1}
>> pretty(sym(maple('factor(x^4*y^2+3*x^3+y^7*x+3*y^5+2*x*y^2+6)')))
2 3 5
(x y + 3) (x + y + 2)
2-3. Simplifying Algebraic Expressions
The following commands enable MATLAB to simplify algebraic expressions:
We give several examples which involve the command simplify:
>> syms x y b c
>> simplify (sin (x) ^ 2 + cos (x) ^ 2)
ans =
1
>> simplify(exp(a+log(b*exp(c))))
ans =
b*exp(a+c)
>> pretty(sym(maple('simplify((x^a)^b+4^(1/2), power)')))
(a b)
x + 2
>> pretty (sym (maple ('simplify (sin (x) ^ 4 + 2 * cos (x) ^ 2 - 2 * sin (x) ^ 2 - cos(2*x), trig)')))
4
cos(x)
>> pretty (sym (maple ('simplify(-1/3*x^5*y+x^4*y^2+1/3*x*y^3+1, {x^3=x*y, y^2=x+1})')))
5 4 2 3
1 + y + y - y + y - 2y
>> pretty (sym (maple ('simplify (((x-1) ^ 2) ^(3/2) * sqrt(a^2), assume(x-1>0))')))
3
(x~ - 1) csgn(a) a
The tilde (~) that appears at the top-right of the variable x indicates that a condition x has been assumed.
>> pretty(sym(maple('simplify(exp(5*ln(x)+1), power)')))
5
x exp(1)
>> pretty (sym (maple ('simplify (cos (x) ^ 5 + sin (x) ^ 4 + 2 * cos (x) ^ 2 - 2 * sin (x) ^ 2 - cos(2*x))')))
5 4
cos(x) + cos(x)
>> pretty (sym (maple ('simplify(-1/3*x^5*y + x^4*y^2 + 1/3*x*y^3 + 1,{x ^ 3 = x * y, y ^ 2 = x + 1})')))
5 4 2 3
1 + y + y - y + y - 2 y
>> pretty(sym(maple('simplify((x+1)^(4/3)-x*(x+1)^(1/3),radical)')))
1/3
(x + 1)
>> pretty(sym(maple('simplify(Ei(1,i*x)+Ei(1,-i*x),Ei)')))
-2 cosint(x)
>> pretty(sym(maple('simplify(n!/((2*n)^2)!, GAMMA)')))
gamma(n + 1)
---------------
2
gamma(4 n + 1)
We now give some examples of how the simple command works:
>> pretty (sym (simple (cos (3 * acos (x)))))
3
4 x - 3 x
>> [R, HOW] = simple (cos (3 * acos (x)))
R =
4 * x ^ 3-3 * x
HOW =
expand
In the latter case, the command that led to the final simplification was expand:
>> pretty (simple (cos (x) + (-sin (x) ^ 2) ^(1/2)))
cos(x) + i sin (x)
>> pretty(simple((x^2-y^2) /(x-y) ^ 3))
x + y
----------
2
(x - y)
EXERCISE 2-7
Given the functions g(x) = sqrt x2 and e(x) =(-8ab3)1/3, simplify them as much as possible. Perform the simplification of g(x) for a real argument and a positive argument. Also simplify e(x) for positive radical and then negative b.
>> pretty(sym(maple('simplify(sqrt(x^2))')))
csgn(x) x
>> pretty(sym(maple('simplify(sqrt(x^2),assume=real)')))
signum(x) x
>> pretty(sym(maple('simplify(sqrt(x^2),assume=positive)')))
x
>> pretty(sym(maple('simplify((-8*b^3*a)^(1/3))')))
3 1/3
2 (-b a)
>> pretty(sym(maple('simplify((-8*b^3*a)^(1/3),radical,symbolic)')))
1/3
2 b (-a)
>> pretty(sym(maple('simplify((-8*b^3*a)^(1/3),assume(b<0),radical)')))
1/3
-2 b~ a
EXERCISE 2-8
Directly simplify the expression ((x-1)2)3/2 (a2)1/2. Then simplify it assuming the condition that x > 1. Finally, perform a simplification assuming in addition that a > 0.
>> pretty(sym(maple('simplify(((x-1) ^ 2) ^(3/2) *(a^2) ^(1/2))')))
3
csgn(x - 1) (x - 1) csgn(a) a
>> pretty(sym(maple('simplify(((x-1)^2)^(3/2)*(a^2)^(1/2),assume(x>1))')))
3
(x~ - 1) csgn(a) a
>> pretty(sym(maple('simplify(((x-1)^2)^(3/2)*(a^2)^(1/2), assume(x>1,a>0))')))
3
(x~ - 1) a~
The last expression also can be simplified without assignments, assuming positive radicals with the option symbolic.
>> pretty(sym(maple('simplify(((x-1)^2)^(3/2)*(a^2)^(1/2),symbolic)')))
3
(x - 1) a
2-4. Combining Algebraic Expressions
MATLAB allows you to combine terms composed of functions of certain types within an algebraic expression, in order to simplify the expression as much as possible after grouping. Among the commands that enable you to do this are the following (always preceded by the command maple):
Here are some examples:
>> pretty(sym(maple('combine(4 * sin (x) ^ 3, trig)')))
-sin(3 x) + sin (x) 3
>> pretty(sym(maple('combine(exp(x) ^ 2 * exp(y), exp)')))
exp(2 x + y)
>> pretty(sym(maple('assume(y>0,z>0):combine(2*ln(y)-ln(z),ln)')))
2
y~
ln(---)
z~
>> pretty(sym(maple('combine((x^a)^2,power)')))
(2 a)
x
>> pretty(sym(maple('combine(Psi(-x)+Psi(x),Psi)')))
2 Psi(x) + Pi cot(Pi x) + 1/x
>> pretty(sym(maple('combine([2*sin(x)*cos(x),2*cos(x)^2-1],trig)')))
[sin(2 x), cos(2 x)]
>> pretty(sym(maple('combine(Int(x,x=a..b)-Int(x^2,x=a..b))')))
>> pretty(sym(maple('combine(Limit(x,x=a)*Limit(x^2,x=a)+c)')))
>> pretty(sym(maple('combine(conjugate(x) ^ 3 + 3 * conjugate(y) * conjugate(z), conjugate)')))
3
x + 3 y z
>> pretty(sym(maple('combine(x^3*x^(m-3),power)')))
m
x
>> pretty(sym(maple('combine((3^n)^m*3^n,power)')))
n m n
(3 ) 3
>> pretty(sym(maple('assume(m,integer):combine((3^n)^m*3^n,power)')))
(n m~ + n)
3
>> pretty(sym(maple('combine(exp(x)^7*exp(y),power)')))
exp(7 x + y)
>> pretty(sym(maple('combine(piecewise(x > 0, cos(x) ^ 2 + sin(x) ^ 2, exp(x) ^ 2 * exp(y)))')))
| exp(2 x + y) x <= 0
| 1 0 < x
>> pretty(sym(maple('combine(piecewise(x<1, exp(x)*exp(-2*x), x>3, 4*sin(x)^3))')))
| exp(-x) x < 1
|
0 x <= 3
|
| 3 sin(x) - sin(3 x) 3 < x
>> pretty(sym(maple('combine(b*ln(y)+3*ln(y)-ln(1-y)+ln(1+y)/2, ln,anything,symbolic)')))
b 3 1/2
y y (1 + y)
ln(----------------)
1 – y
EXERCISE 2-9
Simplify as much as possible the trigonometric-exponential expression exp (sin (a) * cos (b)) * exp (cos (a) * (b), as well as the polylogarithmic expression polylog(a, x) + polylog(a,-x). Simplify the polylogarithmic expression defined by polylog(4,x) + polylog(4,1/x) assuming first that x > 1, and secondly that x is between - 1 and 1.
>> maple combine (exp (sin (a) * cos (b)) * exp (cos (a) * (b)), [trig, exp])
exp(sin(a + b))
>> maple combine(polylog(a,x)+polylog(a,-x),polylog)
(1 - a) 2
2 polylog(a, x )
>> pretty(sym(maple('polylog(4,x) + polylog(4,1/x)')))
polylog(4, x) + polylog(4, 1/x)
>> pretty(sym(maple('assume(x > 1):combine(polylog(4,x) + polylog(4,1/x), polylog)')))
2 2 4 4
- 1/12 ln(-x~) Pi - 7/360 Pi - 1/24 ln(-x~)
>> pretty(sym(maple('assume(x, RealRange(-1,1)):combine(polylog(4,x) + polylog(4,1/x),polylog)')))
1 2 2 4 1 4
- 1/12 ln(- ----) Pi - 7/360 Pi - 1/24 ln(- ----)
x~ x~
EXERCISE 2-10
Simplify the following expressions as much as possible:
, ,
>> pretty(sym(maple('combine(sqrt(2)*sqrt(6) + sqrt(2)*sqrt(x+1),radical)')))
1/2 1/2
2 3 + (2 x + 2)
>> pretty(sym(maple('combine(sqrt(4-sqrt(3))*sqrt(4+sqrt(3)),radical)')))
1/2
13
>> pretty(sym(maple('combine(sqrt(x)*sqrt(y) + sqrt(2)*sqrt(x+1)^3*sqrt(y), radical)')))
1/2 1/2 1/2 1/2
x y + (x + 1) y (2 x + 2)
EXERCISE 2-11
Combine terms as much as possible in the following expression:
a * ln(x) + 3 * ln(x) - ln(1-x) + ln(1+x)/2
Simplify assuming that is real and x > 0. Additionally, try to simplify assuming that x is real and that it varies between 0 and 1.
>> pretty(sym(maple('combine(a*ln(x)+3*ln(x)-ln(1-x)+ln(1+x)/2,ln)')))
a ln(x) + 3 ln(x) - ln(1 - x) + 1/2 ln(1 + x)
>> pretty(sym(maple('assume(a,real):assume(x>0):combine(a*ln(x)+3*ln(x) -ln(1-x)+ln(1+x)/2,ln)')))
3 1/2
a~ ln(x~) - ln(1 - x~) + ln(x~ (x~ + 1) )
>> pretty(sym(maple('assume(a,real):assume(x,RealRange(0,1)): combine(a*ln(x)+3*ln(x)-ln(1-x)+ln(1+x)/2,ln)')))
3 1/2
x~ (x~ + 1)
a~ ln(x~) + ln(---------------)
1 - x~
The additional assumption does not improve the result.
EXERCISE 2-12
Expand and simplify the following trigonometric expressions as much as possible:
(a) sin[3 x] cos[5 x]
(b) cot[a]2 + (sec[a])2 - (csc[a])2
(c) sin[a] / (1 + cot[a]2) - sin[a]3
>> pretty(sym(maple('combine(sin(3*x)*cos(5*x),trig)')))
1/2 sin (x 8) - 1/2 sin (2 x)
>> pretty(sym(maple('simplify((cot(a))^2+(sec(a))^2-(csc(a))^2, trig)')))
2
cos(a) - 1
- --------------
2
cos(a)
>> pretty(sym(maple('simplify(sin(a)/(1 + cot(a) ^ 2)-sin(a) ^ 3, trig)')))
0
EXERCISE 2-13
Simplify the following trigonometric expressions as much as possible:
(a) sin[3 Pi/2 + a] cot[3 Pi/2] / cot[3 Pi/2 + a] + tan[3 Pi/2] cot[Pi/2 + a] / sin[3 Pi/2 + a] cot[-a]
(b) (a2 - b2) cot[Pi-a] / tan[Pi/2] - (a2 + b2) tan[Pi/2-a] / cot[Pi-a]
(c) (cot[a] + tan[a]) / (cot[a]-tan[a]) - sec[2a]
(d) sin[a-b] cos[c] + sin[b- c] cos[a] + sin[c-a] cos[b]
>> pretty(sym(maple('simplify(sin(3*Pi/2+a)*cot(3*Pi/2-a)/cot(3*Pi/2+a)+
(tan(3*Pi/2-a) * cot(Pi/2+a) /sin(3*Pi/2+a) * cot(-a), trig)')))
cos(a) sin (a) - 1
----------------------
sin(a)
>> pretty(sym(maple('combine(sin(3*Pi/2+a)*cot(3*Pi/2-a)/cot(3*Pi/2+a)+
(tan(3*Pi/2-a) * cot(Pi/2+a) /sin(3*Pi/2+a) * cot(-a), trig)')))
2
cos(2 a) + 1 - 2 cot (a) tan (a)
1/2 -------------------------------
cos(a)
>> pretty(sym(maple('simplify((a^2-b^2)*cot(Pi-a)/tan(Pi/2-a)-
(a^2+b^2)*tan(Pi/2-a)/cot(Pi-a),trig)')))
2
2 b
>> pretty(sym(maple('combine((a^2-b^2)*cot(Pi-a)/tan(Pi/2-a)-
(a^2+b^2)*tan(Pi/2-a)/cot(Pi-a),trig)')))
2
2 b
>> pretty(sym(maple('simplify((cot(a)+tan(a))/(cot(a)-tan(a))-sec(2*a), trig)')))
0
>> pretty (sym (maple ('combine (sin(a-b) * cos(c) + sin(b-c) * cos(a) +
sin(c-a) * cos(b), trig)')))
0
In general, you will get the most efficient simplification of trigonometric expressions using the commands combine and simplify, with the option trig.
2-5. Grouping of Similar Terms in Algebraic Expressions
MATLAB allows you to group terms within algebraic expressions according to specified variables. This helps to simplify the expression and possibly to optimize performance. Among the commands that enable the grouping of similar terms in algebraic expressions, we have the following:
Let’s see some examples of the command collect:
>> syms x y z p a
>> pretty(collect( (x+1)*(x+2) ))
2
x + 3 x + 2
>> pretty (collect (y * (sin (x) + 1) + sin (x), sin (x)))
(y + 1) sin(x) + y
>> pretty(collect(x^3*y+x^2*y^3+x+3, y))
3 2 3
x y + x y + x + 3
' p = x * y+ z * x * y+ y* x ^ 2-z * y* x ^ 2 + x + z * x;
>> pretty(collect(p, [x,y]))
2 2
x y + z x y + y x - z y x + x + z x
>> f = a*log(x)-log(x)*x-x;
>> pretty(collect(f,log(x)))
(a - x) ln(x) - x
>> g = int(x^2*(exp(x)+exp(-x)),x);
>> pretty(collect(g,exp(x)))
2
2 -2 x - 2 - x
(2 + x - 2 x) exp(x) + -------------
exp(x)
>> pretty (sym (maple ('collect(x*y+a*x*y+y*x^2-a*y*x^2+x+a*x, [x,y], recursive)')))
2
(1 - a) y x + ((1 + a) y + 1 + a) x
>> pretty (sym (maple ('collect(x*y+a*x*y+y*x^2-a*y*x^2+x+a*x, [y,x], recursive)')))
2
((1 - a) x + (1 + a) x) y + (1 + a) x
>> pretty (sym (maple ('collect(x*y+a*x*y+y*x^2-a*y*x^2+x+a*x, [x,y], distributed)')))
2
(1 + a) x + (1 + a) x y + (1 - a) y x
EXERCISE 2-14
Given the function f (x) = a3x - x + a3 + a, group terms in the variable x, and then factorize the coefficients. Group terms in x for the function p (x) = y/x+2z/x+x1/3- y1/3x.
>> syms a x y z
>> pretty(collect(a^3*x-x+a^3+a, x))
3 3
(a - 1) x + a + a
>> pretty(sym(maple('collect(a^3*x-x+a^3+a, x,factor)')))
2 2
(a - 1) (a + a + 1) x + a (a + 1)
>> pretty (collect (y/x+2 * z/x + x ^(1/3) - y* ^(1/3) x, x))
1/3 y + 2 z
(1 - y) x + -------
x
EXERCISE 2-15
Given the following differential expression:
Group terms in differentials. Subsequently, group terms into sines.
>> pretty (sym (maple ('DF: = diff (y (x), x, x) * sin (x) - diff (y (x), x) * sin (y(x)) + sin (x) * diff (y (x), x) + sin (y (x)) * diff (y (x), x, x)')));
>> pretty(sym(maple('collect(DF,diff)')))
/ 2
/d |d |
(-sin(y (x)) + sin(x)) | - y (x) | +(sin(x) + sin(y(x))) |- y (x) |
dx / | 2 |
dx /
>> pretty(sym(maple('collect(DF,sin)')))
/ / 2 \ // 2
| /d |d || ||d | /d |
|-|-- y(x)| + |--- y(x)|| sin(y(x)) + ||--- y(x)| + |-- y(x)|| sin(x)
| dx / | 2 || || 2 | dx /|
dx // \dx / /
2-6. Sorting Terms in Algebraic Expressions
MATLAB also allows the sorting of terms within algebraic expressions in terms of specified variables. This helps to generate the best possible expression for optimal performance. Among the commands that enable the management of terms in algebraic expressions are the following:
Here are some examples:
>> pretty(sym(maple('sort([3,2,1])')))
[1, 2, 3]
>> pretty(sym(maple('sort(1+x+x^2)')))
2
x + x + 1
>> pretty(sym(maple('sort([c,a,d],lexorder)')))
[a, c, d]
>> pretty(sym(maple('sort(y^3+y^2*x^2+x^3,[x,y])')))
2 2 3 3
x y + x + y
>> pretty(sym(maple('sort(y^3+y^2*x^2+x^3,[x,y],plex)')))
3 2 2 3
x + x y + y
>> pretty(sym(maple('sort((y+x)/(y-x),x)')))
x + y
------
-x + y
>> pretty(sym(maple('sort(x+x^3+w^5+y^2+z^4,[w,x,y,z])')))
5 4 3 2
w + z + x + y + x
>> pretty(sym(maple('sort(x+x^3+w^5+y^2+z^4,[w,x,y,z],plex)')))
5 3 2 4
w + x + x + y + z
>> pretty(sym(maple('sort(x+x^3+w^5+y^2+z^4,[w,x,y,z],tdeg)')))
5 4 3 2
w + z + x + y + x
>> pretty(sym(maple('sort(x*y^5+x^3*y*z+w^5*y^3+y^2*z^4+z^4,[w,x,y,z],plex)')))
5 3 3 5 2 4 4
w y + x y z + x y + y z + z
>> pretty(sym(maple('sort(x*y^5+x^3*y*z+w^5*y^3+y^2*z^4+z^4,[w,x,y,z],tdeg)')))
5 3 5 2 4 3 4
w y + x y + y z + x y z + z
2-7. Algebraic Fractions
MATLAB also enables you to work fluidly with algebraic fractions. Among the commands that can be used we have the following (all of which must be preceded by the command maple):
Here are some examples:
>> pretty(sym(maple('normal((x^2-y^2) /(x-y) ^ 3)')))
x + y
--------
2
(x y)
>> pretty(sym(maple('normal((f (x) ^ 2-1) / (f (x) - 1))')))
f (x) + 1
>> pretty(sym(maple('normal({2/x + y/3 = 0})')))
6 + y x
{1/3 ------- = 0}
x
>> pretty(sym(maple('normal( 1/x+x/(x+1) )')))
2
x + 1 + x
----------
x (x + 1)
>> pretty(sym(maple('normal( 1/x+x/(x+1),expanded)')))
2
x + 1 + x
----------
2
x + x
>> pretty(sym(maple('numer( (1+x)/x^(1/2)/y ) ')))
x + 1
>> pretty(sym(maple('numer( 2/x + y )')))
2 + y x
>> pretty(sym(maple('numer( x+1/(x+1/x))')))
2
x (x + 2)
>> pretty(sym(maple('denom(x+1/(x+1/x))')))
2
x + 1
>> pretty(sym(maple('Normal( (x^3-2*x^2+2*x+1)/(x^4+1)) mod 5')))
x + 3
------
2
x + 3
>> pretty(sym(maple('evala(Normal((x^2-2)/(x-RootOf(_Z^2-2))))')))
2
x + RootOf(_Z-2)
>> pretty(sym(maple('expand((x+1)/(x+2))')))
x 1
----- + -----
x + 2 x + 2
>> pretty(sym(maple('expand(y^3*(x+1)^3/((x+2)*y^2))')))
3 2
yx yx yx y
----- + 3 ----- + 3 ----- + -----
x + 2 x + 2 x + 2 x + 2
>> pretty(sym(maple('factor((x^3-y^3)/(x^4-y^4))')))
2 2
x + x y + y
-----------------
2 2
(y + x) (x + y)
>> pretty(sym(maple('factor(y ^ 3 * (x + 1) ^ 3/((x^2+2*x+1) *(y^2+y)))')))
2
(x + 1) y
----------
y + 1
>> pretty(sym(maple('radsimp((1 + 2^(1/2))^(-1)/(1 + 2*x + x^2)^(1/2))')))
1
------------------
1/2
(2 + 1) (x + 1)
>> pretty(sym(maple(' p:= x^5-2*x^4-2*x^3+4*x^2+x-2')))
>> pretty(sym(maple(' f:= 36 / p')))
>> pretty(sym(maple('convert(f,parfrac,x)')))
4 9 3 4
----- - -------- - -------- - -----
x - 2 2 2 x + 1
(x -1) (x + 1)
>> pretty(sym(maple('convert(f,parfrac,x,sqrfree)')))
4 x + 2 x + 2
----- - 4 ------ - 12 ---------
x - 2 2 2 2
x - 1 (x - 1)
>> pretty(sym(maple('f:= 36 / convert(p,sqrfree,x)')))
>> pretty(sym(maple('convert(f,parfrac,x,true)')))
4 x + 2 x + 2
----- - 4 ------ - 12 ---------
x - 2 2 2 2
x - 1 (x - 1)
EXERCISE 2-16
Given the following algebraic fractions:
,
Simplify them all as much as possible and rationalize the denominators.
>> maple('A:=((x^2+2*x*2^(1/2)-2*x*3^(1/2)+5-2*2^(1/2)*3^(1/2))/(x^2-2*x*3^(1/2)+1))')
>> pretty(sym(maple(' radnormal(A) ')))
1/2 1/2
-x - 2 + 3
----------------
1/2 1/2
-x + 2 + 3
>> pretty(sym(maple(' readlib(rationalize):rationalize(A) ')))
2 1/2 1/2 1/2 1/2 2 1/2
(- x - 2 x 2 + 2 x 3 - 5 + 2 2 3 ) (x + 1 + 2 x 3 )
- -------------------------------------------------------
4 2
x - 10 x + 1
>> pretty(sym(maple(' B:= 1/(2^(1/2)+3^(1/2)+6^(1/2)) ')))
>> pretty(sym(maple(' radnormal(B) ')))
1
-----------------------
1/2 1/2 1/2 1/2
2 + 3 + 2 3
>> pretty(sym(maple(' radnormal(B,rationalized) ')))
1/2 1/2 1/2 1/2 12
5/23 3 - 1/23 2 3 + 7/23 2 - --
23
EXERCISE 2-17
Convert the following algebraic fractions to continued fractions:
,
>> pretty(sym(maple(' convert(1/exp(x),confrac,x) ')))
x
1 + -----------------------
x
-1 + ------------------
x
-2 + -------------
x
3 + ---------
2 1/5 x
>> pretty(sym(maple(' r:= (1+1/2*x+1/12*x^2) / (1-1/2*x+1/12*x^2) ')))
>> pretty(sym(maple(' convert(r,confrac,x) ')))
12
1 + ------------
12
x - 6 + ----
x
EXERCISE 2-18
Break down the following algebraic fractions into simple fractions:
, ,
>> pretty(sym(maple(' f:= (x^5+1)/(x^4-x^2) ')))
>> pretty(sym(maple(' convert(f,parfrac,x) ')))
1 1
x + ----- - ----
x - 1 2
x
>> pretty(sym(maple(' f:= x/(x-b)^2 ')))
>> pretty(sym(maple(' convert(f,parfrac,x) ')))
b 1
-------- + -----
2 x - b
(x - b)
>> pretty(sym(maple(' f:= (2.3*x)/(5.4*x^3-2.3*x+1) ')))
>> pretty(sym(maple(' convert(f,parfrac,x) ')))
.2240312285 .3421473558 + 1.209768633 x
- --------------- + .1851851852 --------------------------------
x +.8091847442 2
x -.8091847442 x +.2288540244
EXERCISE 2-19
Decompose into simple fractions the rational function given by f (x) = (4*x3 - 6*x2 - 2) / (x4-2*x3 - 2*x + 4) over the field of their coefficients, over the real field, over the complex field, and over the algebraic extension Q(√3).
>> pretty(sym(maple(' f:= (4*x^3-6*x^2-2)/(x^4-2*x^3-2*x+4) ')))
>> pretty(sym(maple(' convert(f,parfrac,x) ')))
2
1 x
----- + 3 ------
x - 2 3
x - 2
>> pretty(sym(maple(' convert(f,parfrac,x,real) ')))
1.000000000 1.000000000 1.259921050 + 2. x
--------------- + ----------- + -------------------------------
x-1.259921050 x - 2. 2
x + 1.259921050 x + 1.587401052
>> pretty(sym(maple(' convert(f,parfrac,x,complex) ')))
-9 -9
1 +.2803082855 10 I 1. -.2803082855 10 I
------------------------------- + -------------------------------
x +.6299605249 + 1.091123636 I x +.6299605249 - 1.091123636 I
-10
1 +.2631183713 10 I 1.000000000
+ ------------------------ + -----------
x - 1.259921050 x - 2
>> pretty(sym(maple(' convert(f,parfrac,x,2^(1/3)) ')))
1/3
2 + 2 x 1 1
------------------ + -------- + -----
2 1/3 2/3 1/3 x - 2
x + 2 x + 2 x - 2
EXERCISE 2-20
Perform the following algebraic operations, simplifying the results as much as possible:
To treat operations with algebraic fractions, the best command to use is normal, but you can also use the simple commands factor and simplify:
>> pretty (sym (maple ('normal (x / (x + y) - y/(x-y) + 2 * x * y/(x^2-y^2))')))
1
>> pretty (sym (maple ('factor (x / (x + y) - y/(x-y) + 2 * x * y/(x^2-y^2))')))
1
>> pretty (sym (maple ('simplify (x / (x + y) - y/(x-y) + 2 * x * y/(x^2-y^2))')))
1
>> pretty(sym(maple('normal((1+a^2)/b + (1-b^2)/a - (a^3-b^3)/(a*b))')))
a + b
-----
a b
>> pretty(sym(maple('factor((1+a^2)/b + (1-b^2)/a - (a^3-b^3)/(a*b))')))
a + b
-----
a b
>> pretty(sym(maple('simplify((1+a^2)/b + (1-b^2)/a - (a^3-b^3)/(a*b))')))
a + b
-----
a b
EXERCISE 2-21
Simplify the following algebraic fractions as much as possible:
Because these are simple algebraic fractions, use the commands standard, factor or simplify:
>> pretty(sym(maple('normal((a^3-a^2*b+a*c^2-b*c^2)/(a^3+a*c^2+a^2*b+b*c^2))')))
a - b
-----
a + b
>> pretty(sym(maple('factor((a^3-a^2*b+a*c^2-b*c^2)/(a^3+a*c^2+a^2*b+b*c^2))')))
a - b
-----
a + b
>> pretty(sym(maple('simplify((a^3-a^2*b+a*c^2-b*c^2)/(a^3+a*c^2+a^2*b+b*c^2))')))
a - b
-----
a + b
>> pretty(sym(simple(((x^2-9)*(x^2-2*x+1)*(x-3))/((x^2-6*x+9)*(x^2-1)*(x-1)))))
x + 3
-----
x + 1
EXERCISE 2-22
Perform the following algebraic operations, simplifying the results as much as possible.
a) 2
3 x - 1 5 - x 4 x 2 2 4
(———————— - ——————— - ————————) * (x (x + 1) - (x + 4))) / (4 + 5 x)]
x + 2 x - 2 2
x - 4
b)
2 x 2
(—————————————————————————)
4 x
(x - y) ———————————————
2 2
x + 2 x y + y
[———————————————————————————]
y
1 + ————
x 4
(——————————)
y
1 - ————
x
In this type of combined operations, featuring both sums and differences, as well as ratios products and powers of algebraic expressions, the most efficient command is normal:
>> pretty(sym(maple('normal(((3*x-1)/(x+2)-(5-x)/(x-2)-4*x^2/(x^2-4))* ((x^2*(x^2+1)-(x^4+4))/(4+5*x)))')))
-2
>> pretty (sym (maple ('normal (((2 * x /(x-y))/(4*x/(x^2+2*x*y+y^2)))^ 2 /((1+y/x)/(1-y/x))^4)')))
2
1/4 (x - y)
2-8. Transforming Algebraic Expressions by Conversion
MATLAB enables the conversion of an algebraic expression dependent on a specific function into another expression that depends on another function related to the first. An expression can be transformed from logarithmic, trigonometric, inverse trigonometric or hyperbolic to exponentials, factorials to gamma functions, and so on. Among the commands that enable you to do this are the following (all of them must be preceded by the maple command):
Here are some examples:
>> pretty(sym(maple('convert(exp(x^2)-2 * sinh(x^2),exp)')))
1
-------
2
exp(x )
>> pretty(sym(maple('convert(cot(x),expsincos)')))
cos(x)
------
sin(x)
>> pretty(sym(maple('convert(sinh(x),expsincos)')))
1
1/2 exp(x) - 1/2 ------
exp(x)
>> pretty(sym(maple('convert(cot(x),sincos)')))
cos(x)
------
sin(x)
>> pretty(sym(maple('convert(tanh(x),sincos)')))
sinh(x)
-------
cosh(x)
>> pretty(sym(maple('convert(arctanh(x),ln)')))
1/2 ln(x + 1) - 1/2 ln(1 - x)
>> pretty(sym(maple('convert(1/2*exp(x) + 1/2*exp(-x),trig)')))
cosh(x)
>> pretty(sym(maple('convert(cos(x)*sin(x), expln)')))
/ 1 / 1
- 1/2 I |1/2 exp(I x) + 1/2 --------| |exp(I x) - --------|
exp(I x)/ exp(I x)/
>> pretty(sym(maple('convert(binomial(m,3),GAMMA)')))
GAMMA(m + 1)
1/6 ------------
GAMMA(m - 2)
>> pretty(sym(maple('convert(binomial(m,3),factorial)')))
m!
1/6 --------
(m - 3)!
>> pretty(sym(maple('convert(erfc(x),erf)')))
1 - erf(x)
>> pretty(sym(maple('convert(erfc(2,x),erf)')))
2
2 2 x exp(-x )
1/2 x - 1/2 x erf(x) - 1/2 ---------- + 1/4 - 1/4 erf(x)
1/2
Pi
>> pretty(sym(maple('convert(",erfc) ')))
2
2 2 x exp(-x )
1/2 x - 1/2 x (1 - erfc(x)) - 1/2 ---------- + 1/4 erfc(x)
1/2
Pi
>> pretty(sym(maple('convert(BesselI(1/3,x),Airy) ')))
/ 1/3 2/3 1/2
|3 2 |
1/2 |---------|
| 2/3 |
x /
1/2 2/3 1/3 2/3 2/3 1/3 2/3
(-3 AiryAi(1/2 3 2 x ) + AiryBi(1/2 3 2 x ))
>> pretty(sym(maple('convert(HankelH2(-2/3,z),Bessel)')))
BesselJ(-2/3, z) - I BesselY(-2/3, z)
>> pretty(sym(maple('convert(sin(BesselK(1/3,z^2)),Airy)')))
/ 1/3 2/31/2
|3 2 | 2/3 1/3 2 2/3
sin(Pi |---------| AiryAi(1/2 3 2 (z ) ))
| 2 2/3 |
(z ) /
2-9. Subexpressions and Parts of Expressions
MATLAB implements a broad group of commands that allow you to work with subexpressions, either to operate on parts of expressions in general, to perform assignments of parts of expressions, to make substitutions in expressions, or for any other operations on the contents of algebraic expressions. The most important commands for this kind of task are summarized below (all of them must be preceded by the maple command):
Here are some examples:
>> pretty(sym(maple('indets(x*y + z/x)')))
{y, z, x}
>> pretty(sym(maple('e:= x^(1/2) + exp(x^2) + f(9):')))
>> pretty(sym(maple('indets(e), indets(e,function)')))
1/2 2 2
{x, x, exp (x)}, {exp (x), x (9)}
>> pretty(sym(maple('f:= (a+b^3+c)^(4/3)')))
>> pretty(sym(maple('has( f, a ), has( f, b^3 ), has( f, b^2 ), has( f, a+b^3+c )')))
true, true, false, true
>> pretty(sym(maple('f:= Int(g(t),t=a..b)')))
>> pretty(sym(maple('has(f,a), has(f,g), has(f,t)')))
true, true, true
>> pretty(sym(maple('e:= sin(x)+exp(y)+1')))
>> pretty (sym (maple (' hasfun(e,exp), hasfun(e,cos), hasfun(e,exp,y), hasfun(e,exp,x),
hasfun(e,exp,[x,y]), hasfun(e,{sin,cos},x)')))
true, false, true, false, true, true
>> pretty(sym(maple(' f:= x^(1/2)*y ')))
>> pretty(sym(maple('hastype(f,`*`), hastype(f, `+`), hastype(f, name^fraction),
hastype(f,integer^fraction), hastype(f,radical ), hastype( f,function )')))
true, false, true, false, true, false
>> pretty(sym(maple('readlib(freeze): z:= freeze(x+y)')))
>> pretty(sym(maple(' thaw(z) ')))
x + y
>> pretty(sym(maple('w:= f(g(a,b),h(c,d))')))
>> pretty(sym(maple('op(1,op(2,w)), op([2,1],w), op([-1,-1],w)')))
c, c, d
>> pretty(sym(maple('Int(sin(sqrt(x)),x=0..t)')))
>> pretty(sym(maple('subsop( [1,1]=u, " ), subsop( 1=2*u*op(1,"), [2,1]=u, " ),
applyop( sqrt, [2,2,2], " )')))
>> pretty (sym (maple ('readlib (isolate): isolate (4 * x * sin (x) = 3, sin (x)),
isolate(x^2-3*x-5,x^2)')))
2
sin (x) = 3/4 x, x = 3 x + 5
>> pretty(sym(maple(' f:= 2*exp(a*x)*sin(x)*ln(y) ')))
>> pretty(sym(maple('select(has, f, x),
remove(has, f, x)')))
exp (w x) sin (x), 2 ln (y)
>> pretty(sym(maple('attributes(a), setattribute(a,blue), attributes(a)')))
a, blue
>> pretty(sym(maple('setattribute(a,yellow,green)')))
A
>> pretty(sym(maple('attributes(a)')))
yellow, green
EXERCISE 2-23
Perform the substitution sin (x)2= 1-cos (x)2 in the following expression: sin (x)3 - cos (x) sin (x)2 + cos (x)2 sin (x) + cos (x)3. Also substitute PV/T = R in the expression P2 V/T2 - PR.
>> pretty (sym (maple ('f: = sin (x) ^ 3-cos (x) * sin (x) ^ 2 + cos (x) ^ 2 * sin (x) + cos (x) ^ 3')))
>> pretty (sym (maple ('algsubs (sin (x) ^ 2 = 1 - cos (x) ^ 2, f)')))
3
sin (x) - cos (x) + 2 cos (x)
>> pretty(sym(maple('algsubs( P*V/T=R, P^2*V/T^2-P*R) ')))
R P
-P R + ---
T
EXERCISE 2-24
Perform the replacement defined by x2+ 3 = k in the expressions (x2 + 3 x + 3)3+ x and ((x2 + 3x + 3)3 + x) / (x2 +2)2.
>> pretty(sym(maple('readlib(asubs):')))
>> pretty(sym(maple('asubs( x^2 + 3 =k, (x^2 + 3*x + 3 ) ^ 3 + x )')))
3
(3 x + k) + x
>> pretty(sym(maple('asubs( x^2 + 3 =k, (x^2 + 3*x + 3 ) ^ 3 + x ,always)')))
3 2
(3 x + k) + x - x - 3 + k
>> pretty(sym(maple('asubs( x^2 + 3 =k, ((x^2 + 3*x + 3 ) ^ 3 + x)/(x^2 +2)^2)')))
3
(3 x + k) + x
--------------
2
(-1 + k)
EXERCISE 2-25
Change the variable x = r1/3 in the expression 3xln(x3) and also change the variable sin (x) = y in the expression sin(x) / (1-sin (x))1/2.
>> pretty(sym(maple('subs(x=r^(1/3), 3*x*log(x^3))')))
1/3
3 r log(r)
>> pretty (sym (maple ('subs (y= sin (x), sin (x) / (1 - sin (x)) ^(1/2))')))
y
----------
1/2
(1 - y)