Polynomial Long Division Calculator

The calculator will perform the long division of polynomials, with steps shown.

Show Instructions
  • In general, you can skip the multiplication sign, so `5x` is equivalent to `5*x`.
  • In general, you can skip parentheses, but be very careful: e^3x is `e^3x`, and e^(3x) is `e^(3x)`.
  • Also, be careful when you write fractions: 1/x^2 ln(x) is `1/x^2 ln(x)`, and 1/(x^2 ln(x)) is `1/(x^2 ln(x))`.
  • If you skip parentheses or a multiplication sign, type at least a whitespace, i.e. write sin x (or even better sin(x)) instead of sinx.
  • Sometimes I see expressions like tan^2xsec^3x: this will be parsed as `tan^(2*3)(x sec(x))`. To get `tan^2(x)sec^3(x)`, use parentheses: tan^2(x)sec^3(x).
  • Similarly, tanxsec^3x will be parsed as `tan(xsec^3(x))`. To get `tan(x)sec^3(x)`, use parentheses: tan(x)sec^3(x).
  • From the table below, you can notice that sech is not supported, but you can still enter it using the identity `sech(x)=1/cosh(x)`.
  • If you get an error, double check your expression, add parentheses and multiplication signs where needed, and consult the table below.
  • All suggestions and improvements are welcome. Please leave them in comments.
The following table contains the supported operations and functions:
TypeGet
Constants
ee
pi`pi`
ii (imaginary unit)
Operations
a+ba+b
a-ba-b
a*b`a*b`
a^b, a**b`a^b`
sqrt(x), x^(1/2)`sqrt(x)`
cbrt(x), x^(1/3)`root(3)(x)`
root(x,n), x^(1/n)`root(n)(x)`
x^(a/b)`x^(a/b)`
abs(x)`|x|`
Functions
e^x`e^x`
ln(x), log(x)ln(x)
ln(x)/ln(a)`log_a(x)`
Trigonometric Functions
sin(x)sin(x)
cos(x)cos(x)
tan(x)tan(x), tg(x)
cot(x)cot(x), ctg(x)
sec(x)sec(x)
csc(x)csc(x), cosec(x)
Inverse Trigonometric Functions
asin(x), arcsin(x), sin^-1(x)asin(x)
acos(x), arccos(x), cos^-1(x)acos(x)
atan(x), arctan(x), tan^-1(x)atan(x)
acot(x), arccot(x), cot^-1(x)acot(x)
asec(x), arcsec(x), sec^-1(x)asec(x)
acsc(x), arccsc(x), csc^-1(x)acsc(x)
Hyperbolic Functions
sinh(x)sinh(x)
cosh(x)cosh(x)
tanh(x)tanh(x)
coth(x)coth(x)
1/cosh(x)sech(x)
1/sinh(x)csch(x)
Inverse Hyperbolic Functions
asinh(x), arcsinh(x), sinh^-1(x)asinh(x)
acosh(x), arccosh(x), cosh^-1(x)acosh(x)
atanh(x), arctanh(x), tanh^-1(x)atanh(x)
acoth(x), arccoth(x), cot^-1(x)acoth(x)
acosh(1/x)asech(x)
asinh(1/x)acsch(x)

Divide (dividend):

By (divisor):

Write all suggestions in comments below.

Solution

Your input: find $$$\frac{x^{3} - 12 x^{2} + 38 x - 17}{x - 7}$$$ using long division.

Write the problem in a special format:

$$$\require{enclose}\begin{array}{rlc}\phantom{\color{Magenta}{x}-7}&\phantom{\enclose{longdiv}{}-}\begin{array}{rrrr}\phantom{x^{2}}&\phantom{- 5 x}&\phantom{+3}&\phantom{-17}\end{array}&\\x-7&\phantom{-}\enclose{longdiv}{\begin{array}{cccc}x^{3}&- 12 x^{2}&+38 x&-17\end{array}}&\\\phantom{\color{Magenta}{x}-7}&\begin{array}{rrrr}\end{array}&\begin{array}{c}\end{array}\end{array}$$$

Step 1

Divide the leading term of the dividend by the leading term of the divisor: $$$\frac{x^{3}}{x}=x^{2}$$$.

Write down the calculated result in the upper part of the table.

Multiply it by the divisor: $$$x^{2}\left(x-7\right)=x^{3}- 7 x^{2}$$$.

Subtract the dividend from the obtained result: $$$\left(x^{3}- 12 x^{2}+38 x-17\right)-\left(x^{3}- 7 x^{2}\right)=- 5 x^{2}+38 x-17$$$.


$$$\require{enclose}\begin{array}{rlc}\phantom{\color{Magenta}{x}-7}&\phantom{\enclose{longdiv}{}-}\begin{array}{rrrr}\color{Fuchsia}{x^{2}}&\phantom{- 5 x}&\phantom{+3}&\phantom{-17}\end{array}&\\\color{Magenta}{x}-7&\phantom{-}\enclose{longdiv}{\begin{array}{cccc}\color{Fuchsia}{x^{3}}&- 12 x^{2}&+38 x&-17\end{array}}&\frac{\color{Fuchsia}{x^{3}}}{\color{Magenta}{x}}=\color{Fuchsia}{x^{2}}\\\phantom{\color{Magenta}{x}-7}&\begin{array}{rrrr}-\phantom{x^{3}}&\phantom{- 12 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}x^{3}&- 7 x^{2}\\\hline\phantom{\enclose{longdiv}{}}&- 5 x^{2}&+38 x&-17\end{array}&\begin{array}{c}\phantom{x^{3}- 12 x^{2}+38 x-17}\\\color{Fuchsia}{x^{2}}\left(\color{Magenta}{x}-7\right)=x^{3}- 7 x^{2}\\\phantom{- 5 x^{2}+38 x-17}\end{array}\end{array}$$$

Step 2

Divide the leading term of the obtained remainder by the leading term of the divisor: $$$\frac{- 5 x^{2}}{x}=- 5 x$$$.

Write down the calculated result in the upper part of the table.

Multiply it by the divisor: $$$- 5 x\left(x-7\right)=- 5 x^{2}+35 x$$$.

Subtract the remainder from the obtained result: $$$\left(- 5 x^{2}+38 x-17\right)-\left(- 5 x^{2}+35 x\right)=3 x-17$$$.


$$$\require{enclose}\begin{array}{rlc}\phantom{\color{Magenta}{x}-7}&\phantom{\enclose{longdiv}{}-}\begin{array}{rrrr}x^{2}&\color{DeepPink}{- 5 x}&\phantom{+3}&\phantom{-17}\end{array}&\\\color{Magenta}{x}-7&\phantom{-}\enclose{longdiv}{\begin{array}{cccc}x^{3}&- 12 x^{2}&+38 x&-17\end{array}}&\\\phantom{\color{Magenta}{x}-7}&\begin{array}{rrrr}-\phantom{x^{3}}&\phantom{- 12 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}x^{3}&- 7 x^{2}\\\hline\phantom{\enclose{longdiv}{}}&\color{DeepPink}{- 5 x^{2}}&+38 x&-17\\&-\phantom{- 5 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}&- 5 x^{2}&+35 x\\\hline\phantom{\enclose{longdiv}{}}&&3 x&-17\end{array}&\begin{array}{c}\phantom{x^{3}- 12 x^{2}+38 x-17}\\\phantom{\color{Fuchsia}{x^{2}}\left(\color{Magenta}{x}-7\right)=x^{3}- 7 x^{2}}\\\frac{\color{DeepPink}{- 5 x^{2}}}{\color{Magenta}{x}}=\color{DeepPink}{- 5 x}\\\phantom{- 5 x^{2}+38 x-17}\\\color{DeepPink}{- 5 x}\left(\color{Magenta}{x}-7\right)=- 5 x^{2}+35 x\\\phantom{3 x-17}\end{array}\end{array}$$$

Step 3

Divide the leading term of the obtained remainder by the leading term of the divisor: $$$\frac{3 x}{x}=3$$$.

Write down the calculated result in the upper part of the table.

Multiply it by the divisor: $$$3\left(x-7\right)=3 x-21$$$.

Subtract the remainder from the obtained result: $$$\left(3 x-17\right)-\left(3 x-21\right)=4$$$.


$$$\require{enclose}\begin{array}{rlc}\phantom{\color{Magenta}{x}-7}&\phantom{\enclose{longdiv}{}-}\begin{array}{rrrr}x^{2}&- 5 x&\color{Green}{+3}&\phantom{-17}\end{array}&\\\color{Magenta}{x}-7&\phantom{-}\enclose{longdiv}{\begin{array}{cccc}x^{3}&- 12 x^{2}&+38 x&-17\end{array}}&\\\phantom{\color{Magenta}{x}-7}&\begin{array}{rrrr}-\phantom{x^{3}}&\phantom{- 12 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}x^{3}&- 7 x^{2}\\\hline\phantom{\enclose{longdiv}{}}&- 5 x^{2}&+38 x&-17\\&-\phantom{- 5 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}&- 5 x^{2}&+35 x\\\hline\phantom{\enclose{longdiv}{}}&&\color{Green}{3 x}&-17\\&&-\phantom{3 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}&&3 x&-21\\\hline\phantom{\enclose{longdiv}{}}&&&\color{Crimson}{4}\end{array}&\begin{array}{c}\phantom{x^{3}- 12 x^{2}+38 x-17}\\\phantom{\color{Fuchsia}{x^{2}}\left(\color{Magenta}{x}-7\right)=x^{3}- 7 x^{2}}\\\phantom{- 5 x^{2}+38 x-17}\\\phantom{- 5 x^{2}+38 x-17}\\\phantom{\color{DeepPink}{- 5 x}\left(\color{Magenta}{x}-7\right)=- 5 x^{2}+35 x}\\\frac{\color{Green}{3 x}}{\color{Magenta}{x}}=\color{Green}{3}\\\phantom{3 x-17}\\\color{Green}{3}\left(\color{Magenta}{x}-7\right)=3 x-21\\\phantom{4}\end{array}\end{array}$$$

Since the degree of the remainder is less than the degree of the divisor, then we are done.

The resulting table is shown once more:

$$$\require{enclose}\begin{array}{rlc}\phantom{\color{Magenta}{x}-7}&\phantom{\enclose{longdiv}{}-}\begin{array}{rrrr}\color{Fuchsia}{x^{2}}&\color{DeepPink}{- 5 x}&\color{Green}{+3}&\phantom{-17}\end{array}&Hints\\\color{Magenta}{x}-7&\phantom{-}\enclose{longdiv}{\begin{array}{cccc}\color{Fuchsia}{x^{3}}&- 12 x^{2}&+38 x&-17\end{array}}&\frac{\color{Fuchsia}{x^{3}}}{\color{Magenta}{x}}=\color{Fuchsia}{x^{2}}\\\phantom{\color{Magenta}{x}-7}&\begin{array}{rrrr}-\phantom{x^{3}}&\phantom{- 12 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}x^{3}&- 7 x^{2}\\\hline\phantom{\enclose{longdiv}{}}&\color{DeepPink}{- 5 x^{2}}&+38 x&-17\\&-\phantom{- 5 x^{2}}&\phantom{+38 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}&- 5 x^{2}&+35 x\\\hline\phantom{\enclose{longdiv}{}}&&\color{Green}{3 x}&-17\\&&-\phantom{3 x}&\phantom{-17}\\\phantom{\enclose{longdiv}{}}&&3 x&-21\\\hline\phantom{\enclose{longdiv}{}}&&&\color{Crimson}{4}\end{array}&\begin{array}{c}\phantom{x^{3}- 12 x^{2}+38 x-17}\\\color{Fuchsia}{x^{2}}\left(\color{Magenta}{x}-7\right)=x^{3}- 7 x^{2}\\\frac{\color{DeepPink}{- 5 x^{2}}}{\color{Magenta}{x}}=\color{DeepPink}{- 5 x}\\\phantom{- 5 x^{2}+38 x-17}\\\color{DeepPink}{- 5 x}\left(\color{Magenta}{x}-7\right)=- 5 x^{2}+35 x\\\frac{\color{Green}{3 x}}{\color{Magenta}{x}}=\color{Green}{3}\\\phantom{3 x-17}\\\color{Green}{3}\left(\color{Magenta}{x}-7\right)=3 x-21\\\phantom{4}\end{array}\end{array}$$$

Therefore, $$$\frac{x^{3} - 12 x^{2} + 38 x - 17}{x - 7}=x^{2} - 5 x + 3+\frac{4}{x - 7}$$$

Answer: $$$\frac{x^{3} - 12 x^{2} + 38 x - 17}{x - 7}=x^{2} - 5 x + 3+\frac{4}{x - 7}$$$