[OS X TeX] Binomial Expansion

Alain Schremmer Schremmer.Alain at gmail.com
Thu Nov 23 18:11:07 CET 2006


Claus Gerhardt wrote:

> Happy Birthday Alain!

Thank you!

> I had a look at the polynom.sty manual. It is only 6 pages and well  
> written. You should give it a try.

I did about a year ago and I have been using \polylongdiv ever since. 
That was not the point of my post. What I wanted to do over the 
Christmas break was to learn a little bit about programming in LaTeX. 
The idea was to write, in the spirit of polylongdiv, a command

    \Expand{a}{b}{some degree}

that would expand and typeset (a+b)^n. I am still going, The TeX Book in 
hand, to try.

> If \Expand{a}{b}{some degree} should represent polynomial division, then
>
> \polylongdiv[stage=3] {(X-1)(X-1)(X^2+1)^4} {(X-1)(X+1)(X+1)}
>
> might be what you want. 

Not really since I can expand (a+b)^n in my head and polylongdiv gives 
me the output but no source to copy-paste.

Nevertheless, \polylongdiv{(x+a)^{n}}{1}(with an actual value for n) is 
indeed very neat and I will try to cut some more from polynom.sty to get 
rid of the division (I already got rid of Horner but that was a bit of 
trial and error.)

What I wanted was to learn a bit about LaTeX along the theme of writing 
the command.

But, indeed, I hadn't realized that polylongdiv could multiply which of 
course was dumb since it has to multiply in order to divide (not quite 
as in "we had to destroy the city in order to save it" of everlasting fame.)

Of course, what I would kill for is a polylongdiv in ascending order. 
But, as I wrote, Heinz didn't respond to my two requests so I think she 
or he has better things to do.

Very grateful regards
--schremmer
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list