Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In Maple, how can I partially factor an expression?

To partially factor an expression in Maple, consider the following example. Suppose you want to change the first line below to the second:

a b + a c + b c a (b + c) + b c

The following simple procedure will work for many examples:

> pullout := proc(f,e) local f0; f0:= subs(e=0,f); normal(f0) + e * normal((f - f0)/e); end:

You can then use this newly defined procedure as follows:

> pullout(a*b + a*c + b*c,a); b c + a (b + c)

However, the above won't get the b + c partial factorization.

> pullout(a*b + a*c + b*c, b+c); a b + a c + b c

Above, replacing subs in algsubs in the definition of pullout results in a procedure that will rewrite some additional expressions. However, sometimes this may yield undesirable results by "trying too hard", for instance:

> algpullout:= proc(f,e) local f0; f0:= algsubs(e=0,f); normal(f0) + e * normal((f - f0)/e); end: > algpullout(a*b + a*c + b*c,b+c); -c2 + (b + c) (a + c)

This information is derived with permission from a Usenet news message posted by Robert Israel in the newsgroup sci.math.symbolic.

For more about Maple, see Maple at IU.

For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

This is document adht in domain all.
Last modified on April 20, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.