We first write the quotient as a division problem:
\begin{gather*}
\require{enclose}x+3 \enclose{longdiv}{2x^2+x-7}\kern-.2ex
\end{gather*}
and divide \(2x^2\) (the first term of the numerator) by \(x\) (the first term of the denominator) to obtain \(2x\text{.}\) (It may be helpful to write down the division: \(\dfrac{2x^2}{2x}=x\text{.}\)) We write \(\alert{2x}\) above the quotient bar as the first term of the quotient, as shown below.
Next, we multiply \(x+3\) by \(2x\) to obtain \(2x^2 + 6x\text{,}\) and subtract this product from \(2x^2 + x - 7\text{:}\)
\begin{align*}
\require{enclose}
\begin{array}[t]{rll}
\alert{2x} \hphantom{1+x-7}&& \\[-3pt]
x+3 \enclose{longdiv}{2x^2+x-7}\kern-.2ex && \blert{\text{Multiply }2x \text{ by } x+3.}\\[-3pt]
\underline{-(2x^2+6x)\phantom{11}} && \blert{\text{Subtract the result}.}\\[-3pt]
-5x-7
\end{array}
\end{align*}
Repeating the process, we divide \(-5x\) by \(x\) to obtain \(-5\text{.}\) We write \(\alert{-5}\) as the second term of the quotient. Then we multiply \(x+3\) by \(-5\) to obtain \(-5x - 15\text{,}\) and subtract:
\begin{align*}
\require{enclose}
\begin{array}[t]{rll}
2x\alert{-5} \hphantom{x-11}&& \\[-3pt]
x+3 \enclose{longdiv}{2x^2+x-7}\kern-.2ex \phantom{11}&& \\[-3pt]
\underline{-(2x^2+6x)\phantom{11}} \phantom{11}&& \\[-3pt]
-5x-7\phantom{11} && \blert{\text{Multiply } {-5} \text{ by }x+3.} \\[-3pt]
\underline{-(-5x-15)} &&\blert{\text{Subtract the result}.} \\[-3pt]
8\phantom{11}
\end{array}
\end{align*}
Because the degree of the remainder, 8, is less than the degree of \(x + 3\text{,}\) the division is finished. The quotient is \(2x - 5\text{,}\) with a remainder of \(8\text{.}\) We write the remainder as a fraction to obtain
\begin{equation*}
\dfrac{2x^2 + x - 7}{x + 3} = 2x - 5 + \dfrac{8}{x + 3}
\end{equation*}