Evaluate the integral: I = integral
Evaluate the integral: $$ I = \int \frac{1-x+x^2}{\sqrt{1+x-x^2}}\,dx. $$
Explanation of Method
Writing $1-x+x^2=-(1+x-x^2)+2$ splits the integral into a standard radical integral and a standard arcsine integral.
- Rewrite the numerator in terms of $1+x-x^2$.
- Split into two integrals.
- Integrate each piece.
Step 1 · Rewrite the numerator
Matching coefficients in $1-x+x^2=A(1+x-x^2)+B(1-2x)+C$ gives $A=-1,\ B=0,\ C=2$, so:
$$ \frac{1-x+x^2}{\sqrt{1+x-x^2}} = -\sqrt{1+x-x^2} + \frac2{\sqrt{1+x-x^2}}. $$
Step 2 · Complete the square and integrate
$1+x-x^2=\tfrac54-(x-\tfrac12)^2$. Using $\int dx/\sqrt{5/4-(x-1/2)^2}=\arcsin\left(\tfrac{2x-1}{\sqrt5}\right)$ and $\int\sqrt{5/4-(x-1/2)^2}\,dx=\tfrac{2x-1}4\sqrt{1+x-x^2}+\tfrac58\arcsin\left(\tfrac{2x-1}{\sqrt5}\right)$:
$$ I = -\left[\frac{2x-1}4\sqrt{1+x-x^2}+\frac58\arcsin\left(\frac{2x-1}{\sqrt5}\right)\right] + 2\arcsin\left(\frac{2x-1}{\sqrt5}\right) + C. $$
Step 3 · Combine
$$ I = -\frac{(2x-1)\sqrt{1+x-x^2}}4 + \left(2-\frac58\right)\arcsin\left(\frac{2x-1}{\sqrt5}\right) + C. $$
Summary Table
| Coefficient | Value |
|---|---|
| $A$ | $-1$ |
| $B$ | $0$ |
| $C$ | $2$ |
Additional Notes
- The domain is $\dfrac{1-\sqrt5}2<x<\dfrac{1+\sqrt5}2$.
- The result was verified numerically at $x=0$: the derivative evaluates to $1$, matching the integrand $(1-0+0)/\sqrt{1+0-0}=1$ there.
Result
The solution to the integral is: