Theorem: integral_rpow
File: Mathlib/Analysis/SpecialFunctions/Integrals.lean

tactic: have :
  (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
  integral_cpow h'
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
⊢ (∫ (x : ℝ) in a..b, x ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1)

tactic: apply_fun Complex.re at this
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r) = (↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)
⊢ (∫ (x : ℝ) in a..b, x ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1)

tactic: convert this
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ (∫ (x : ℝ) in a..b, x ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1)

tactic: cases h
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
⊢ -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]

tactic: left
state_before: case inl
a b : ℝ
n : ℕ
r : ℝ
h✝ : -1 < r
⊢ -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]

tactic: rwa [Complex.ofReal_re]
state_before: case inl.h
a b : ℝ
n : ℕ
r : ℝ
h✝ : -1 < r
⊢ -1 < (↑r).re

tactic: right
state_before: case inr
a b : ℝ
n : ℕ
r : ℝ
h✝ : r ≠ -1 ∧ ¬0 ∈ [[a, b]]
⊢ -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]

tactic: rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
state_before: case inr.h
a b : ℝ
n : ℕ
r : ℝ
h✝ : r ≠ -1 ∧ ¬0 ∈ [[a, b]]
⊢ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]

tactic: simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ (∫ (x : ℝ) in a..b, x ^ r) = (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re

tactic: have : Complex.re = IsROrC.re := by rfl
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ ((if a ≤ b then 1 else -1) • ∫ (x : ℝ) in Ι a b, x ^ r) = (if a ≤ b then 1 else -1) * (∫ (x : ℝ) in Ι a b, ↑x ^ ↑r).re

tactic: rw [this, ← integral_re]
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
⊢ ((if a ≤ b then 1 else -1) • ∫ (x : ℝ) in Ι a b, x ^ r) = (if a ≤ b then 1 else -1) * (∫ (x : ℝ) in Ι a b, ↑x ^ ↑r).re

tactic: rfl
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
⊢ ((if a ≤ b then 1 else -1) • ∫ (x : ℝ) in Ι a b, x ^ r) =
    (if a ≤ b then 1 else -1) * ∫ (a : ℝ) in Ι a b, ↑IsROrC.re (↑a ^ ↑r)

case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
⊢ MeasureTheory.Integrable fun x => ↑x ^ ↑r

tactic: refine' intervalIntegrable_iff.mp _
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
⊢ MeasureTheory.Integrable fun x => ↑x ^ ↑r

tactic: cases' h' with h' h'
state_before: case h.e'_2
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
⊢ IntervalIntegrable (fun x => ↑x ^ ↑r) MeasureTheory.volume a b

tactic: rfl
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ Complex.re = ↑IsROrC.re

tactic: exact intervalIntegrable_cpow' h'
state_before: case h.e'_2.inl
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
h' : -1 < (↑r).re
⊢ IntervalIntegrable (fun x => ↑x ^ ↑r) MeasureTheory.volume a b

tactic: exact intervalIntegrable_cpow (Or.inr h'.2)
state_before: case h.e'_2.inr
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this✝ : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
this : Complex.re = ↑IsROrC.re
h' : ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ ↑r) MeasureTheory.volume a b

tactic: rw [(by push_cast; rfl : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
state_before: case h.e'_3
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re

tactic: simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
state_before: case h.e'_3
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) = ((↑b ^ ↑(r + 1) - ↑a ^ ↑(r + 1)) / ↑(r + 1)).re

tactic: rfl
state_before: case h.e'_3
a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ (r + 1)⁻¹ * (b ^ (r + 1) - a ^ (r + 1)) = (r + 1)⁻¹ * ((↑b ^ ↑(r + 1)).re - (↑a ^ ↑(r + 1)).re)

tactic: push_cast
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ ↑r + 1 = ↑(r + 1)

tactic: rfl
state_before: a b : ℝ
n : ℕ
r : ℝ
h : -1 < r ∨ r ≠ -1 ∧ ¬0 ∈ [[a, b]]
h' : -1 < (↑r).re ∨ ↑r ≠ -1 ∧ ¬0 ∈ [[a, b]]
this : (∫ (x : ℝ) in a..b, ↑x ^ ↑r).re = ((↑b ^ (↑r + 1) - ↑a ^ (↑r + 1)) / (↑r + 1)).re
⊢ ↑r + 1 = ↑r + 1