5
$\begingroup$

The analytic expression can be obtained for f.

f = Integrate[AiryAi[x], x]

-((x (-3 Gamma[1/3] Gamma[5/3] HypergeometricPFQ[{1/3}, {2/3, 4/3}, x^3/9] + 3^(1/3) x Gamma[2/3]^2 HypergeometricPFQ[{2/3}, {4/3, 5/3}, x^3/ 9]))/(9 3^(2/3) Gamma[2/3] Gamma[4/3] Gamma[5/3]))

Therefore, the minimum value within a certain range of x can be obtained by NMinimize.

NMinimize[f, {x, -8, 8}]

{-0.941019, {x -> -2.33811}}

m = Integrate[AiryAi[x] Exp[x], x]

However, there is no way to find the minimum value of m (the analytic expression cannot be obtained by integration)

Is there any way to find the minimum value of m within a certain range of x? thank you.

$\endgroup$
1
  • 2
    $\begingroup$ You don't have any bounds on your Integrate. The minimum in either case is undefined unless you provide bounds because as you should know from calculus, the antiderivative has a $+C$ term which can be any number. I assume you mean the canonical integral from $0$ to $x$ ? $\endgroup$
    – flinty
    Commented Jan 22, 2023 at 14:24

5 Answers 5

7
$\begingroup$
  • We calculate the integral by f'[x] == AiryAi[x] Exp[x] and f[0]=Integrate[AiryAi[x] Exp[x], {x, -∞, 0}]
  • To calculate f[c] we using ParametricNDSolveValue in the neighbourhood of c,that is {c-1,c+1}.
Clear[int, sol, min];
int = Integrate[AiryAi[x] Exp[x], {x, -∞, 0}];
sol = ParametricNDSolveValue[{f'[x] == AiryAi[x] Exp[x], f[0] == int},
    f, {x, c - 1, c + 1}, {c}];
min = NMinimize[sol[c]@c, {c}]
Plot[sol[c]@c, {c, -10, 10}, Mesh -> {{c /. min[[2]]}}, 
 MeshStyle -> {AbsolutePointSize[10],  Red}]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ We can get all of the minima by setting C[1] be a odd number. extremum = Solve[{Exp[x] AiryAi[x] == 0}, x, Reals][[1]]; D[Exp[x] AiryAi[x], x] > 0 /. extremum /. C[1] -> # & /@ {1, 3, 5, 7, 9, 11, 13} $\endgroup$
    – cvgmt
    Commented Jan 23, 2023 at 11:54
  • $\begingroup$ You can use FindMinimum instead. $\endgroup$
    – TheDoctor
    Commented Jan 25, 2023 at 9:03
  • $\begingroup$ @TheDoctor No. We want to find the Global minimum, we cann't assuming -10<x<10 or using FindMinimum. $\endgroup$
    – cvgmt
    Commented Jan 25, 2023 at 9:08
7
$\begingroup$

I'm assuming you are integrating from $0$ to $t$ and ignoring the $+c$ term that should be present in any antiderivative. In that case, you can just solve when the derivative equals zero (and check the 2nd derivative is positive):

m = Integrate[AiryAi[x] Exp[x], {x,0,t}]
mint = t /. First@Solve[D[m,t] == 0, t];
Reduce[(D[m, {t, 2}] /. t -> AiryAiZero[1]) > 0]
minval = N[m /. t -> mint]

The minimum value occurs at t == AiryAiZero[1] which is approximately -2.33811. And the minimum is N[Integrate[AiryAi[x] Exp[x], {x, 0, t}] /. t -> AiryAiZero[1]] which is approximately -0.396162

$\endgroup$
3
  • $\begingroup$ If we use {x, -Infinity, t} as Sumit's answer assumes, then we get a minimum value at the same AiryAiZero[1] point but minimum of -0.0174104 which corroborates their answer. $\endgroup$
    – flinty
    Commented Jan 22, 2023 at 15:19
  • $\begingroup$ Clear[m, mint]; m = Integrate[AiryAi[t] Exp[t], t]; mint = Solve[E^t AiryAi[t] == 0, t, Reals][[1]]; Reduce[D[m, {t, 2}] > 0 /. (mint[[1]] /. C[1] -> #)] & /@ Range[100] $\endgroup$
    – cvgmt
    Commented Jan 23, 2023 at 4:34
  • $\begingroup$ Via the first fundamental theorem the derivative of the integral is AiryAi[t] Exp[t] which clearly vanishes only when AiryAi[t]==0 $\endgroup$
    – TheDoctor
    Commented Jan 25, 2023 at 8:35
6
$\begingroup$
Clear["Global`*"]

Define m with a numeric integral

m[t_?NumericQ] := 
  NIntegrate[AiryAi[x] Exp[x], {x, -Infinity, t}]

{min, arg} = NMinimize[m[t], t]

(* {-0.0174104, {t -> -2.33811}} *)

Plot[m[t], {t, -10, 10},
 Epilog -> {Red, AbsolutePointSize[4],
   Point[{t, min} /. arg]}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Instead of using NIntegrate—which has to compute the integral separately for each value of t— one can use the exact integral y0 = Integrate[AiryAi[x] Exp[x], {x, -Infinity, 0}] and then use NDSolve: NDSolve[{y'[x]==AiryAi[x] Exp[x], y[0]==y0, y, {x,-10,10}] $\endgroup$
    – TheDoctor
    Commented Jan 25, 2023 at 8:50
  • $\begingroup$ @TheDoctor Since the goal is using NMinimize for all x, so we cann't assume that -10<x<10 To speed up ,we can set Clear[int, m]; int = Integrate[AiryAi[x] Exp[x], {x, -\[Infinity], 0}]; m[t_?NumericQ] := int + NIntegrate[AiryAi[x] Exp[x], {x, 0, t}] ; {min, arg} = NMinimize[m[t], t] // AbsoluteTiming $\endgroup$
    – cvgmt
    Commented Jan 25, 2023 at 9:19
  • $\begingroup$ The goal is to find the global minimum, not to use NMinimize for all x. Using the first fundamental theorem the derivative of the integral is AiryAi[t] Exp[t] which vanishes iff t = AiryAiZero[n]. And, for a minimum, the second derivative is positive iff AiryAiPrime[AiryAiZero[n]] > 0. $\endgroup$
    – TheDoctor
    Commented Feb 5, 2023 at 15:49
5
$\begingroup$

You can extract numerical data and create an interpolating function.

Here I am assuming $g(y) = \int_{-\infty}^y f(x)dx $ and using -1000 for $-\infty$. Depending on your function you may need a different limiting value.

int[y_] := NIntegrate[AiryAi[x] Exp[x], {x, -1000, y}]
data = Table[{y, int[y]}, {y, -10, 10, 0.1}];
f = Interpolation[data]

z0 = NMinimize[f[x], {x, -8, 8}]

{-0.0174105, {x -> -2.33813}}

Show[ListPlot[data], Plot[f[x], {x, -8, 8}, PlotStyle -> Black],
     Epilog -> {Red, Point[{x /. z0[[2]], z0[[1]]}]} ]

enter image description here

$\endgroup$
2
$\begingroup$

Using: $$\int \text{Ai}(x) \sum _{j=0}^{\infty } \frac{x^j}{j!} \, dx=\sum _{j=0}^{\infty } \int \frac{\text{Ai}(x) x^j}{j!} \, dx$$

f[x_, M_] := Sum[-((x^(1 + j) (-3 Gamma[(1 + j)/
    3] HypergeometricPFQRegularized[{(1 + j)/3}, {2/3, (4 + j)/3},
     x^3/9] + 
  3^(1/3) x Gamma[(2 + j)/
    3] HypergeometricPFQRegularized[{(2 + j)/3}, {4/3, (5 + j)/3},
     x^3/9]))/(9 3^(2/3) j!)), {j, 0, M}]

Terms=20;(* Only 20 ! *)
NMinimize[f[x, Terms], {x, -3, 0}, WorkingPrecision -> 20]
(*{-0.39616201050130477798, {x -> -2.3381074104597670385}}*)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.