4

Ok! So...was really pleased when I discovered that polynom will just do polynomial long division for me like it's no big deal. But...is there a function for multiplying polynomials? I seem to have found something called \polymul in the manual, but...there isn't any detail about how to use it (and I keep getting errors when trying to multiply simple polynomials): http://cs.brown.edu/about/system/managed/latex/doc/polynom.pdf

Any suggestions would be helpful!

Torbjørn T.
  • 206,688
  • 2
    Not sure why someone would vote this down... – Tanner Strunk Apr 16 '17 at 22:41
  • Hi, welcome. I didn't downvote, but it could be because you haven't shown what you tried. – Torbjørn T. Apr 16 '17 at 22:46
  • Welcome to TeX.SX! Please show us the code that you have tried and the precise error messages. Otherwise it is hard to say what's going wrong. For me the package polynom works when I try the code in the documentation. – gernot Apr 16 '17 at 22:54

1 Answers1

3

Looking at the manual, you could do something like this:

\documentclass{article}
\usepackage{polynom}
\begin{document}
% the next two lines are just to save the two polynoms we want to multiply to \PolynomA and \PolynomB
\polyadd\PolynomA{x-1}{0} % adding zero: trick mentioned in the manual
\polyadd\PolynomB{x^2+2}{0}%
% multiply A and B, save to \SomePolynom
\polymul\SomePolynom\PolynomA\PolynomB
\begin{equation}
(\polyprint\PolynomA)(\polyprint\PolynomB)=\polyprint\SomePolynom
\end{equation}    
\end{document}

enter image description here

In general, you do \polymul\SomeMacronameYouDecideYourself{<first polynom>}{<second polynom>}. To get useful output, you need to use \polyprint\SomeMacronameYouDecideYourself.

Torbjørn T.
  • 206,688
  • Ah got it. Thanks! I couldn't find documentation on polymul...or maybe I just wasn't reading carefully enough. Anyway I ended up putting my things into a polynomial multiplier widget on Wolfram, but I still wanted to know this for the future. Just finished special cases and now moving on to a general case of a research problem! To the abstract notation! – Tanner Strunk Apr 16 '17 at 22:56
  • 1
    @TannerStrunk I didn't actually look at your link before, but it leads to an older version of the manual. Type texdoc polynom in a terminal on your computer, or visit http://texdoc.net/texmf-dist/doc/latex/polynom/polynom.pdf for the latest version. Then have a look at section 4.6 (Low-level commands), which is where I got the info for this answer. – Torbjørn T. Apr 16 '17 at 23:06