But it is returning the same. I need this to complete my research. Please help.
The expression used by me in mathematica is:
Integrate[Log2[1+x^2]*(PDF[NormalDistribution[\[Mu], \[Sigma]], x]),{x,-Infinity,Infinity}]
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityIt is obvious to consider a numerical solution
int[\[Mu]_?NumericQ, \[Sigma]_?NumericQ] :=
NIntegrate[E^(-((x - \[Mu])^2/(2 \[Sigma]^2))) Log[1 + x^2]/(2 Pi \[Sigma] Log[2]), {x, -Infinity, \[Mu] - \[Sigma], \[Mu], \[Mu] + \[Sigma], Infinity} ]
Show[Table[ LogLogPlot[int[\[Mu], \[Sigma]], {\[Sigma], .05, 10} ], {\[Mu], Range[0, 2, .1]}] ]
addendum
Thanks to@yarchik's comment!
Knowing DiracDelta[x-\[Mu]]=Limit[E^(-((x - \[Mu])^2/(2 \[Sigma]^2)))/(Sqrt[2Pi]\[Sigma]),\[Sigma]->0]
it follows
`int[\[Mu],0]==Log[1+\[Mu]^2]/(Sqrt[2Pi] Log[2])`
Clear["Global`*"]
$Assumptions = μ ∈ Reals && σ > 0;
(int = Inactive[Integrate][
Log2[1 + x^2] PDF[NormalDistribution[μ, σ], x],
{x, -∞, ∞}])//TraditionalForm
The integral does not evaluate; however, when μ == 0
int0 = int /. μ -> 0 // Activate
(* -(1/(σ^2 Log[
2]))(HypergeometricPFQ[{1, 1}, {3/2, 2}, 1/(
2 σ^2)] + σ^2 (EulerGamma - π Erfi[1/(
Sqrt[2] σ)] + Log[2] - 2 Log[σ])) *)
Block[{$MaxExtraPrecision = 200},
LogLogPlot[int0, {σ, 10^-4, 10},
PlotRange -> All,
PlotPoints -> 100,
MaxRecursion -> 5,
WorkingPrecision -> 120,
AxesLabel -> (Style[#, 14] & /@
{HoldForm@σ, HoldForm@int0})]] //
Quiet
For the benefit of cut-and-pasters, there is an alternate form at the bottom.
$\text{expr}=\text{FullSimplify}[\text{PDF}[\text{NormalDistribution}[0,\sigma ],x]]$
$\frac{e^{-\frac{x^2}{2 \sigma ^2}}}{\sqrt{2 \pi } \sigma }$
$\text{Assuming}\left[\sigma \in \mathbb{R}\land \sigma >0,\int_{-\infty }^{\infty } \text{expr} \log \left(x^2+1\right) \, dx\right]$
$-\frac{\, _2F_2\left(1,1;\frac{3}{2},2;\frac{1}{2 \sigma ^2}\right)}{\sigma ^2}+\pi \text{erfi}\left(\frac{1}{\sqrt{2} \sigma }\right)+2 \log (\sigma )-\gamma -\log (2)$
The purpose of expr is to completely remove $\mu$ whixh is known to be 0 in this case.
The purpose of the Assuming first expresson is to inform Mathematica that $\sigma$ is positive real.
Perhaps, I missed something?
For the cut-and-pasters (afterwards, right click on the cell bracket and Convert to Standard Form):
expr = FullSimplify[PDF[NormalDistribution[0, \[Sigma]], x]]
1/(E^(x^2/(2*\[Sigma]^2))*(Sqrt[2*Pi]*\[Sigma]))
Assuming[Element[\[Sigma], Reals] && \[Sigma] > 0,
Integrate[expr*Log[x^2 + 1], {x, -Infinity, Infinity}]]
-EulerGamma + Pi*Erfi[1/(Sqrt[2]*\[Sigma])] -
HypergeometricPFQ[{1, 1}, {3/2, 2}, 1/(2*\[Sigma]^2)]/
\[Sigma]^2 - Log[2] + 2*Log[\[Sigma]]
This also works:
$\text{Assuming}\left[\mu =0,\int_{-\infty }^{\infty } \log \left(x^2+1\right) \text{PDF}[\text{NormalDistribution}[\mu ,\sigma ],x] \, dx\right]$
Assuming[\[Mu] == 0, Integrate[PDF[NormalDistribution[\[Mu], \[Sigma]], x]*
Log[x^2 + 1], {x, -Infinity, Infinity}]]
b
is close to zero we get:b Sqrt[2 \[Pi]] \[Sigma] (\[Mu]^2 + \[Sigma]^2)
. See:AsymptoticIntegrate[ E^(-((x - \[Mu])^2/(2 \[Sigma]^2))) Log[1 + b x^2], {x, -Infinity, Infinity}, {b, 0, 1}]
$\endgroup$