Mode of #cas
laplace
The Laplace transform of a sum of polynomial, exponential, trigonometric and hyperbolic terms, with a theorem about the integral.
#cas [laplace t s] flaplace gives the transform of a concrete function, together with a proof that the integral converges and has that value. The theorem is about Mathlib’s integral over Set.Ioi 0, the half-line , with the integrand exactly as you wrote it.
Each term has a transform in closed form, and the transform of a sum is the sum of the transforms. The bound on is printed as the domain. It is enough for convergence, though not always the smallest such bound. To go back from a rational function of , use inverseLaplace.
Examples (19)#
Basic Examples (2)
The transform of , with the theorem for every :
#cas [laplace t s] (t * sin (2 * t))
Laplace transform
4*s/(s^2 + 4)^2- Domain
s > 0- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(t * sin (2 * t))
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (t * Real.sin (2 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (t * Real.sin (2 * t)) = 4 * s / (s ^ 2 + 4) ^ 2
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (t * Real.sin (2 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (t * Real.sin (2 * t)) = 4 * s / (s ^ 2 + 4) ^ 2
A sum is transformed term by term, and the bound on is the largest bound of its terms:
#cas [laplace t s] (3 * t ^ 2 * exp (2 * t) + cos (5 * t))
Laplace transform
6/(s - 2)^3 + s/(s^2 + 25)- Domain
s > 2- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(3 * t ^ 2 * exp (2 * t) + cos (5 * t))
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 2 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (3 * t ^ 2 * Real.exp (2 * t) + Real.cos (5 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (3 * t ^ 2 * Real.exp (2 * t) + Real.cos (5 * t)) = 6 / (s - 2) ^ 3 + s / (s ^ 2 + 25)
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 2 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (3 * t ^ 2 * Real.exp (2 * t) + Real.cos (5 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (3 * t ^ 2 * Real.exp (2 * t) + Real.cos (5 * t)) = 6 / (s - 2) ^ 3 + s / (s ^ 2 + 25)
Scope (5)
A constant:
#cas [laplace t s] 1
Laplace transform
1/s- Domain
s > 0- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
1
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * 1) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * 1 = 1 / s
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * 1) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * 1 = 1 / s
A decaying exponential and a power of :
#cas [laplace t s] (exp (-t) - 2 * t ^ 3)
Laplace transform
1/(s + 1) - 12/s^4- Domain
s > 0- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(exp (-t) - 2 * t ^ 3)
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (-t) - 2 * t ^ 3)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (-t) - 2 * t ^ 3) = 1 / (s + 1) - 12 / s ^ 4
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 0 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (-t) - 2 * t ^ 3)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (-t) - 2 * t ^ 3) = 1 / (s + 1) - 12 / s ^ 4
A power, an exponential and a cosine in one term. The factor shifts the transform to :
#cas [laplace t s] (t ^ 2 * exp (t / 2) * cos (3 * t))
Laplace transform
(2*(s - 1/2)^3 - 54*(s - 1/2))/((s - 1/2)^2 + 9)^3- Domain
s > 1/2- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(t ^ 2 * exp (t / 2) * cos (3 * t))
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 1 / 2 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (t ^ 2 * Real.exp (t / 2) * Real.cos (3 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (t ^ 2 * Real.exp (t / 2) * Real.cos (3 * t)) = (2 * (s - 1 / 2) ^ 3 - 54 * (s - 1 / 2)) / ((s - 1 / 2) ^ 2 + 9) ^ 3
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 1 / 2 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (t ^ 2 * Real.exp (t / 2) * Real.cos (3 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (t ^ 2 * Real.exp (t / 2) * Real.cos (3 * t)) = (2 * (s - 1 / 2) ^ 3 - 54 * (s - 1 / 2)) / ((s - 1 / 2) ^ 2 + 9) ^ 3
A negative rate and a negative frequency. The bound on is :
#cas [laplace t s] (exp (-(3 / 2) * t) * sin (-2 * t))
Laplace transform
-(2/((s + 3/2)^2 + 4))- Domain
s > -3/2- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(exp (-(3 / 2) * t) * sin (-2 * t))
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), -(3 / 2) < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (-(3 / 2) * t) * Real.sin (-2 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (-(3 / 2) * t) * Real.sin (-2 * t)) = -(2 / ((s + 3 / 2) ^ 2 + 4))
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), -(3 / 2) < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (-(3 / 2) * t) * Real.sin (-2 * t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (-(3 / 2) * t) * Real.sin (-2 * t)) = -(2 / ((s + 3 / 2) ^ 2 + 4))
The hyperbolic functions. For cosh (b * t) and sinh (b * t) the bound is :
#cas [laplace t s] (cosh (3 * t))
Laplace transform
s/(s^2 - 9)- Domain
s > 3- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(cosh (3 * t))
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * Real.cosh (3 * t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * Real.cosh (3 * t) = s / (s ^ 2 - 9)
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * Real.cosh (3 * t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * Real.cosh (3 * t) = s / (s ^ 2 - 9)
#cas [laplace t s] (exp (2 * t) * sinh t)
Laplace transform
1/((s - 2)^2 - 1)- Domain
s > 3- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(exp (2 * t) * sinh t)
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (2 * t) * Real.sinh t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (2 * t) * Real.sinh t) = 1 / ((s - 2) ^ 2 - 1)
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.exp (2 * t) * Real.sinh t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.exp (2 * t) * Real.sinh t) = 1 / ((s - 2) ^ 2 - 1)
Applications (1)
The transform of 1 in a proof. cas proves the integral for , and only the three standard axioms are used:
theorem laplace_one (s : ℝ) (hs : 0 < s) : ∫ t in Set.Ioi (0 : ℝ), Real.exp (-(s * t)) * 1 = 1 / s := by cas #print axioms laplace_one
laplace_one depends on the axioms propext, Classical.choice, Quot.sound.
Properties and Relations (2)
The transform is linear. Written with exponentials, has the transform :
#cas [laplace t s] ((exp (3 * t) - exp (-(3 * t))) / 2)
Laplace transform
3/(s^2 - 9)- Domain
s > 3- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
((exp (3 * t) - exp (-(3 * t))) / 2)
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * ((Real.exp (3 * t) - Real.exp (-(3 * t))) / 2)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * ((Real.exp (3 * t) - Real.exp (-(3 * t))) / 2) = 3 / (s ^ 2 - 9)
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 3 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * ((Real.exp (3 * t) - Real.exp (-(3 * t))) / 2)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * ((Real.exp (3 * t) - Real.exp (-(3 * t))) / 2) = 3 / (s ^ 2 - 9)
inverseLaplace goes back. The transform of is :
#cas [inverseLaplace s t] (1 / (s - 1) ^ 3)
an inverse Laplace transform (its transform is F for s > σ; uniqueness is not claimed)
1/2*t^2*exp(t)- Domain
s > 1- Input (proper rational function of s)
(1 / (s - 1) ^ 3)
Checked by Lean’s kernel: Inverse Laplace transform
∀ (s : ℝ), 1 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (1 / 2 * (t ^ 2 * Real.exp t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (1 / 2 * (t ^ 2 * Real.exp t)) = 1 / (s - 1) ^ 3
The certificate: 1 checked step
Inverse Laplace transform
∀ (s : ℝ), 1 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (1 / 2 * (t ^ 2 * Real.exp t))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (1 / 2 * (t ^ 2 * Real.exp t)) = 1 / (s - 1) ^ 3
Possible Issues (8)
The printed bound is enough for convergence and need not be the smallest one. Here the input is , whose transform exists for , and the bound of the two terms is :
#cas [laplace t s] (cosh t - sinh t)
Laplace transform
s/(s^2 - 1) - 1/(s^2 - 1)- Domain
s > 1- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(cosh t - sinh t)
Checked by Lean’s kernel: Laplace transform
∀ (s : ℝ), 1 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.cosh t - Real.sinh t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.cosh t - Real.sinh t) = s / (s ^ 2 - 1) - 1 / (s ^ 2 - 1)
The certificate: 1 checked step
Laplace transform
∀ (s : ℝ), 1 < s → MeasureTheory.IntegrableOn (fun t ↦ Real.exp (-(s * t)) * (Real.cosh t - Real.sinh t)) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (t : ℝ) in Set.Ioi 0, Real.exp (-(s * t)) * (Real.cosh t - Real.sinh t) = s / (s ^ 2 - 1) - 1 / (s ^ 2 - 1)
A product of two of the functions cos, sin, cosh and sinh is not one term. Write it as a sum first, here (exp t * cos t + exp (-t) * cos t) / 2:
#cas [laplace t s] (cosh t * cos t)
Error
laplace: expected a sum of terms c tⁿ e ^ (a t) g (b t) with g one of cos, sin, cosh, sinh, or c tⁿ e ^ (a t), with rational a, b, c and b ≠ 0 (parameters are not supported)
The integral of diverges for every . The input is not a sum of the terms above, and it is refused:
#cas [laplace t s] (exp (t ^ 2))
Error
laplace: expected a sum of terms c tⁿ e ^ (a t) g (b t) with g one of cos, sin, cosh, sinh, or c tⁿ e ^ (a t), with rational a, b, c and b ≠ 0 (parameters are not supported)
Parameters are refused. The rates, frequencies and coefficients are rational numbers:
#cas [laplace t s] (exp (a * t))
Error
laplace: expected a sum of terms c tⁿ e ^ (a t) g (b t) with g one of cos, sin, cosh, sinh, or c tⁿ e ^ (a t), with rational a, b, c and b ≠ 0 (parameters are not supported)
tanh is not one of the functions:
#cas [laplace t s] (tanh t)
Error
laplace: tanh is not supported
Powers of go up to 8. The transform of is :
#cas [laplace t s] (t ^ 9)
Error
laplace accepts powers t ^ n with n ≤ 8
At most 8 terms:
#cas [laplace t s] (1 + t + t ^ 2 + t ^ 3 + t ^ 4 + t ^ 5 + t ^ 6 + t ^ 7 + t ^ 8)
Error
laplace accepts at most 8 terms
The two variables must be different:
#cas [laplace t t] (exp t)
Error
laplace: the variables t and s must be different
Neat Examples (1)
Other names for the variables. The bound is , and at the integral is :
#cas [laplace x p] (x ^ 8 * exp (-x))
Laplace transform
40320/(p + 1)^9- Domain
p > -1- Input (terms c tⁿ e ^ (a t) g (b t), g = 1, cos, sin, cosh, sinh)
(x ^ 8 * exp (-x))
Checked by Lean’s kernel: Laplace transform
∀ (p : ℝ), -1 < p → MeasureTheory.IntegrableOn (fun x ↦ Real.exp (-(p * x)) * (x ^ 8 * Real.exp (-x))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (x : ℝ) in Set.Ioi 0, Real.exp (-(p * x)) * (x ^ 8 * Real.exp (-x)) = 40320 / (p + 1) ^ 9
The certificate: 1 checked step
Laplace transform
∀ (p : ℝ), -1 < p → MeasureTheory.IntegrableOn (fun x ↦ Real.exp (-(p * x)) * (x ^ 8 * Real.exp (-x))) (Set.Ioi 0) MeasureTheory.volume ∧ ∫ (x : ℝ) in Set.Ioi 0, Real.exp (-(p * x)) * (x ^ 8 * Real.exp (-x)) = 40320 / (p + 1) ^ 9
See Also
inverseLaplace · dsolve · integrate · fourierTransform · gamma
