theorem extracted_formal_statement_104.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] [inst_1 : NeZero μ] (a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ)
  (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b) :
  let f := fun t => cgf X μ t;
  ∀ (t : ℝ),
    (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ →
      HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t →
        HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ) t := sorry

State before:
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝¹ : IsFiniteMeasure μ
inst✝ : NeZero μ
a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
f : ℝ → ℝ := fun t => cgf X μ t
f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω
t : ℝ
g : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ
g' : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω) * X ω) x ∂μ
r0 : (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
⊢ HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t

Tactic: rw [r0]

State after:
[Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝¹ : IsFiniteMeasure μ
 inst✝ : NeZero μ
 a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 f : ℝ → ℝ := fun t => cgf X μ t
 f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω
 t : ℝ
 g : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ
 g' : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω) * X ω) x ∂μ
 r0 : (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
 ⊢ HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ) t]

Relevant lemmas: