The synthetic division table is:
$$ \begin{array}{c|rrrrr}1&3&-22&13&118&-40\\& & 3& -19& -6& \color{black}{112} \\ \hline &\color{blue}{3}&\color{blue}{-19}&\color{blue}{-6}&\color{blue}{112}&\color{orangered}{72} \end{array} $$The solution is:
$$ \dfrac{ 3x^{4}-22x^{3}+13x^{2}+118x-40 }{ x-1 } = \color{blue}{3x^{3}-19x^{2}-6x+112} ~+~ \dfrac{ \color{red}{ 72 } }{ x-1 } $$Step 1 : Write down the coefficients of the dividend into division table. Put the zero from $ x -1 = 0 $ ( $ x = \color{blue}{ 1 } $ ) at the left.
$$ \begin{array}{c|rrrrr}\color{blue}{1}&3&-22&13&118&-40\\& & & & & \\ \hline &&&&& \end{array} $$Step 1 : Bring down the leading coefficient to the bottom row.
$$ \begin{array}{c|rrrrr}1&\color{orangered}{ 3 }&-22&13&118&-40\\& & & & & \\ \hline &\color{orangered}{3}&&&& \end{array} $$Step 2 : Multiply by the number on the left, and carry the result into the next column: $ \color{blue}{ 1 } \cdot \color{blue}{ 3 } = \color{blue}{ 3 } $.
$$ \begin{array}{c|rrrrr}\color{blue}{1}&3&-22&13&118&-40\\& & \color{blue}{3} & & & \\ \hline &\color{blue}{3}&&&& \end{array} $$Step 3 : Add down last column: $ \color{orangered}{ -22 } + \color{orangered}{ 3 } = \color{orangered}{ -19 } $
$$ \begin{array}{c|rrrrr}1&3&\color{orangered}{ -22 }&13&118&-40\\& & \color{orangered}{3} & & & \\ \hline &3&\color{orangered}{-19}&&& \end{array} $$Step 4 : Multiply by the number on the left, and carry the result into the next column: $ \color{blue}{ 1 } \cdot \color{blue}{ \left( -19 \right) } = \color{blue}{ -19 } $.
$$ \begin{array}{c|rrrrr}\color{blue}{1}&3&-22&13&118&-40\\& & 3& \color{blue}{-19} & & \\ \hline &3&\color{blue}{-19}&&& \end{array} $$Step 5 : Add down last column: $ \color{orangered}{ 13 } + \color{orangered}{ \left( -19 \right) } = \color{orangered}{ -6 } $
$$ \begin{array}{c|rrrrr}1&3&-22&\color{orangered}{ 13 }&118&-40\\& & 3& \color{orangered}{-19} & & \\ \hline &3&-19&\color{orangered}{-6}&& \end{array} $$Step 6 : Multiply by the number on the left, and carry the result into the next column: $ \color{blue}{ 1 } \cdot \color{blue}{ \left( -6 \right) } = \color{blue}{ -6 } $.
$$ \begin{array}{c|rrrrr}\color{blue}{1}&3&-22&13&118&-40\\& & 3& -19& \color{blue}{-6} & \\ \hline &3&-19&\color{blue}{-6}&& \end{array} $$Step 7 : Add down last column: $ \color{orangered}{ 118 } + \color{orangered}{ \left( -6 \right) } = \color{orangered}{ 112 } $
$$ \begin{array}{c|rrrrr}1&3&-22&13&\color{orangered}{ 118 }&-40\\& & 3& -19& \color{orangered}{-6} & \\ \hline &3&-19&-6&\color{orangered}{112}& \end{array} $$Step 8 : Multiply by the number on the left, and carry the result into the next column: $ \color{blue}{ 1 } \cdot \color{blue}{ 112 } = \color{blue}{ 112 } $.
$$ \begin{array}{c|rrrrr}\color{blue}{1}&3&-22&13&118&-40\\& & 3& -19& -6& \color{blue}{112} \\ \hline &3&-19&-6&\color{blue}{112}& \end{array} $$Step 9 : Add down last column: $ \color{orangered}{ -40 } + \color{orangered}{ 112 } = \color{orangered}{ 72 } $
$$ \begin{array}{c|rrrrr}1&3&-22&13&118&\color{orangered}{ -40 }\\& & 3& -19& -6& \color{orangered}{112} \\ \hline &\color{blue}{3}&\color{blue}{-19}&\color{blue}{-6}&\color{blue}{112}&\color{orangered}{72} \end{array} $$Bottom line represents the quotient $ \color{blue}{ 3x^{3}-19x^{2}-6x+112 } $ with a remainder of $ \color{red}{ 72 } $.