Math & SciencePolynom package and change of variable

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
coach
Posts: 5
Joined: Wed May 27, 2009 10:47 pm

Polynom package and change of variable

Post by coach »

Dear forum members,

I am having major problems with the polynom package. I am trying to perform polynomial long division on the expression n^3-1. I used the following code

\polyset{vars=n}
\polylongdiv{x^3-1}{x-1}

and the result is in the attachment. The expression goes all weird when I try to change the variable, because I desperately need it to be n instead of x. Why won't the package accept n as a variable?
Could someone please help me?

Thank you!
Attachments
polynomial.jpg
polynomial.jpg (7.86 KiB) Viewed 5332 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Polynom package and change of variable

Post by localghost »

You missed something. When declaring n as a variable, you have to use it as variable. The following code works fine for me.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{polynom}

\parindent0em

\begin{document}
  \polyset{vars=n}
  \polylongdiv{n^3-1}{n-1}
\end{document}
The manual of the polynom package is a little bit misleading in this point.


Best regards
Thorsten
coach
Posts: 5
Joined: Wed May 27, 2009 10:47 pm

Re: Polynom package and change of variable

Post by coach »

Thank you so much!

It works now.
Post Reply