27.11.2014 Views

1.4.6 Simplifying Algebraic Expressions

1.4.6 Simplifying Algebraic Expressions

1.4.6 Simplifying Algebraic Expressions

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

80 1. A Practical Introduction to Mathematica<br />

<strong>1.4.6</strong> <strong>Simplifying</strong> <strong>Algebraic</strong> <strong>Expressions</strong><br />

There are many situations where you want to write a particular algebraic expression<br />

in the \simplest possible form". Although it is dicult to know exactly what one<br />

means in all cases by the \simplest form", a worthwhile practical procedure is to<br />

look at many dierent forms of an expression, and pick out the one that involves<br />

the smallest number of parts.<br />

Simplify[expr]<br />

try to nd the form of expr with the smallest number<br />

of parts, by applying a sequence of dierent algebraic<br />

transformations<br />

<strong>Simplifying</strong> algbraic expressions.<br />

Simplify writes x 2 +2x + 1 in factored<br />

form.<br />

In[1]:= Simplify[x^2 + 2x + 1]<br />

2<br />

Out[1]= (1 + x)<br />

Simplify leaves x 10 ; 1 in expanded form,<br />

since for this expression, the factored form<br />

is larger.<br />

In[2]:= Simplify[x^10 -1]<br />

10<br />

Out[2]= -1 + x<br />

You can often use Simplify to \clean up" complicated expressions that you get<br />

as the results of computations.<br />

1<br />

Here is the integral of<br />

x 4 . Integrals are<br />

;1<br />

discussed in more detail in Section 1.5.<br />

In[3]:= Integrate[1/(x^4-1), x]<br />

-ArcTan[x] Log[-1 + x] Log[1 + x]<br />

Out[3]= ------------------ + ------------------ - ------------------<br />

2 4 4<br />

Dierentiating the result from Integrate<br />

should give back your original expression.<br />

In this case, as is common, you get a more<br />

complicated version of the expression.<br />

In[4]:= D[%, x]<br />

1 1 1<br />

Out[4]= ------------------ - ---------------- - -------------------<br />

4 (-1 + x) 4 (1 + x) 2<br />

2 (1 + x )<br />

Simplify succeeds in getting back the<br />

original, more simple, form of the<br />

expression.<br />

In[5]:= Simplify[%]<br />

1<br />

Out[5]= ------------<br />

4<br />

-1 + x<br />

For many simple algebraic calculations, you may nd it convenient to use<br />

Simplify quite routinely on your results.<br />

In more complicated calculations, however, you often need to exercise more con-<br />

Web sample page from The Mathematica Book, First Edition, by Stephen Wolfram, published by Addison-Wesley Publishing<br />

Company (hardcover ISBN 0-201-19334-5; softcover ISBN 0-201-19330-2). To order Mathematica or this book contact Wolfram<br />

Research: info@wolfram.com; http://www.wolfram.com/; 1-800-441-6284.<br />

c 1988 Wolfram Research, Inc. Permission is hereby granted for web users to make one paper copy of this page for their<br />

personal use. Further reproduction, or any copying of machine-readable files (including this one) to any server computer, is strictly<br />

prohibited.


1.4 Formulae 81<br />

trol over the exact form of answer that you get. In addition, when your expressions<br />

are complicated, Simplify may spend a long time testing a large number of possible<br />

forms, in its attempt to nd the simplest one.<br />

Web sample page from The Mathematica Book, First Edition, by Stephen Wolfram, published by Addison-Wesley Publishing<br />

Company (hardcover ISBN 0-201-19334-5; softcover ISBN 0-201-19330-2). To order Mathematica or this book contact Wolfram<br />

Research: info@wolfram.com; http://www.wolfram.com/; 1-800-441-6284.<br />

c 1988 Wolfram Research, Inc. Permission is hereby granted for web users to make one paper copy of this page for their<br />

personal use. Further reproduction, or any copying of machine-readable files (including this one) to any server computer, is strictly<br />

prohibited.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!