Other Ways to Compute ∫ sin(x+1)/(x³+x²+x+1) dx

Three independent routes to the same closed form, plus a sign slip in the contour step that is easy to copy without noticing.

Binary Buddies · 5 min read · 2 views

The integral of sin(x+1) / (x³ + x² + x + 1) over the whole real line looks like it needs a contour argument with a cubic denominator. It doesn't. The denominator factors as (x+1)(x²+1), and the (x+1) cancels against a zero of the numerator. The integrand therefore has no singularity on the real line.

It is also absolutely convergent. sin(x+1)/(x+1) is bounded by 1 in absolute value, and 1/(x²+1) integrates to π. That matters, because every route below either swaps the order of integration or splits the integrand into pieces that are individually delicate. You need to know which steps are legitimate and which are not.

A Math StackExchange question gave one solution, a double integral followed by a contour integral, and asked for alternatives. This article walks through that solution and the two alternatives from the answers. All three reach π/2 + (π/(2e))(sin 1 − cos 1).

Start with the factorisation

Partial fractions do most of the structural work: 1/((x+1)(x²+1)) = ½ [ 1/(x+1) − (x−1)/(x²+1) ]. You can confirm it by matching coefficients. The x² terms give B = −½, the constants give C = ½, and the x terms then cancel.

Each method uses the factorisation differently. The parameter method keeps 1/(x²+1) and turns sin(x+1)/(x+1) into an integral over a parameter. The residue method keeps the whole rational factor and handles the apparent pole at x = −1 explicitly. The partial-fraction method splits the integrand into three standard integrals.

Route 1: write sin(x+1)/(x+1) as an integral

Use sin(x+1)/(x+1) = ∫₀¹ cos((x+1)y) dy and swap the order of integration. Fubini applies here: on [0,1] × ℝ the integrand is bounded by 1/(x²+1), which is integrable. Expand cos((x+1)y) = cos(xy) cos y − sin(xy) sin y. The sine term is odd in x and integrates to zero, which leaves ∫₀¹ cos y · ∫ cos(xy)/(x²+1) dx dy.

The inner integral equals π e^{−y} for y ≥ 0. The original post gets it by contour integration. One of the answers points out that a Fourier transform or another differentiation under the integral also works.

The same idea can be phrased as Feynman's trick. Define I(a) = ∫ sin(a(x+1))/(x³+x²+x+1) dx. Then I(0) = 0 and I'(a) = π cos(a) e^{−|a|}, so I(1) = π ∫₀¹ e^{−a} cos a da. An antiderivative of e^{−a} cos a is e^{−a}(sin a − cos a)/2. Evaluating between 0 and 1 gives π/2 + (π/(2e))(sin 1 − cos 1).

Route 2: residues from the start

Write the integral as Im( e^i · PV ∫ e^{ix} / ((x+1)(x+i)(x−i)) dx ). The principal value is needed because the complex integrand has a pole at x = −1, even though the imaginary part does not. Close the contour in the upper half-plane. The pole at z = i contributes a full residue, and the pole at z = −1, which sits on the contour, contributes half a residue (πi times the residue).

The residues are e^{−1}/(2i(1+i)) at z = i and e^{−i}/2 at z = −1. That gives 2πi · e^{−1}/(2i(1+i)) + πi e^{−i}/2. Multiply by e^i and take the imaginary part. The first term becomes (π/e) · Im( e^i (1−i)/2 ) = (π/(2e))(sin 1 − cos 1), using 1/(1+i) = (1−i)/2. The second term becomes Im(πi/2) = π/2.

This is the most mechanical route and needs no clever rewriting. The cost is bookkeeping: the half-residue, the factor e^i, and the complex arithmetic.

Route 3: partial fractions and parity

Substitute the partial fractions and expand sin(x+1) = sin x cos 1 + cos x sin 1. Over a symmetric interval, odd parts of the integrand vanish, so only the even parts survive. What remains is ½ [ ∫ sin(x+1)/(x+1) dx + sin 1 ∫ cos x/(x²+1) dx − cos 1 ∫ x sin x/(x²+1) dx ].

The first integral is the Dirichlet integral after the shift x → x−1, so it equals π. The other two both equal π/e over the whole line. Note that the answer giving this route states the value π/e next to a half-line integral. Over [0, ∞) each of those integrals is π/(2e), and the arithmetic only works with the full-line value.

Putting these together gives ½ (π + (π/e) sin 1 − (π/e) cos 1) = (π/2)(1 + (sin 1 − cos 1)/e). This is the shortest write-up of the three. It depends on tabulated integrals, though, and x sin x/(x²+1) behaves like sin x / x at infinity. It converges only conditionally.

Checking that the three agree

All three routes land on the same closed form, which can also be written (π/(2e))(e + sin 1 − cos 1). Numerically it is about 1.745. The first term, π/2, is about 1.5708, and the correction (π/(2e))(sin 1 − cos 1) is about 0.174. The correction is positive because sin 1 > cos 1.

The decomposition also explains where each term comes from. The π/2 is half the Dirichlet integral and corresponds to the pole at x = −1. The e^{−1} part comes from the pole at z = i, which is the only pole that produces exponential decay.

Where this does not fit, and what to watch for

The original post closes the contour for e^{−ixy} in the upper half-plane. For y > 0 that exponential grows on the upper arc, since |e^{−iz y}| = e^{y Im z}, so the argument fails as written. Use e^{ixy} instead, which has the same real part. The residue at z = i is then e^{−y}/(2i), and the result π e^{−y} follows. For y < 0 you would close in the lower half-plane, which is why the answer carries |a|.

The parity trick in Route 3 depends on symmetric limits. The same split over [0, ∞) does not cancel the odd parts, and the pieces change value. Splitting into conditionally convergent integrals is also only safe when you take the limits symmetrically.

The residue route needs the half-residue rule for a simple pole on the contour. A higher-order pole there, or a numerator that is not the imaginary part of an exponential, would need a different treatment. The parameter method works here because sin(x+1)/(x+1) is exactly ∫₀¹ cos((x+1)y) dy. That identity is not available for an arbitrary denominator.

This article draws on Is there any other way to compute $ \int_{-\infty}^{+\infty} \frac{\sin (x+1)}{x^3+x^2+x+1} d x?$ and answers to it (1, 2), on the Stack Exchange network, licensed under CC BY-SA 4.0.

  • #Integration
  • #calculus
  • #contour-integration
  • #improper-integrals
  • #trigonometric-integrals

Comments

Add a comment
Sign in with Google to join the conversation