1
$\begingroup$

This is a sequel of the question Using Mathematica to derive the PDF of the normal distribution.

sol = DSolve[ϕ'[x] == -k (x - μ)/σ^2 ϕ[x], ϕ[x], x]

Gives the Normal law distribution up to a parameter. ---C[1]---. Unfortunately this C[1] is the solution of

Solve [(Integrate[sol[[1, 1, 2]] /. C[1] -> a , {x, -∞, ∞}]) == 1, a] 

but after one hour Mathematica fails to find a solution. It fails also to find the solution with boundary conditions

$\endgroup$
5
  • $\begingroup$ The problem is that Integrate returns a ConditionalExpression; try evaluating the integral first to see what I mean. To get around this, do Integrate[sol[[1, 1, 2]] /. C[1] -> a , {x, -∞, ∞}, Assumptions->{k > 0, μ > 0, σ > 0}] and try again. $\endgroup$ – march Sep 22 '16 at 16:23
  • $\begingroup$ @march $\mu$ doesn't have to be positive. $\endgroup$ – corey979 Sep 22 '16 at 16:27
  • $\begingroup$ @corey979. Right, the condition on $\mu$ is unnecessary. I was just trying to get the point across. $\endgroup$ – march Sep 22 '16 at 16:28
  • $\begingroup$ Of course, if I have seen somebody asking such a question without Assumptions, I would have tell him. Buut I am so absentminded. Sorry. This is a point but not the all story. I have simplified in setting $k=0$ . But the integral is an infinite object and you cannot apply Solve to this tyope of object $\endgroup$ – cyrille.piatecki Sep 22 '16 at 18:06
  • $\begingroup$ of course it was a typesetting mistake $k=0$ was $k=1$. $\endgroup$ – cyrille.piatecki Sep 22 '16 at 19:41
1
$\begingroup$

You do not want to set k = 0

sol = ϕ[x] /. 
  DSolve[ϕ'[x] == -k (x - μ)/σ^2 ϕ[x], ϕ[x], x][[1]]

(*  E^((k*(-(x^2/2) + x*μ))/σ^2)*C[1]  *)

Assuming[{k > 0, σ > 0},
 sol /. Solve[
     Integrate[sol, {x, -Infinity, Infinity}] == 1, C[1]][[1]] // 
  Simplify]

(*  Sqrt[k]/(E^((k*(x - μ)^2)/
           (2*σ^2))*(Sqrt[2*Pi]*σ))  *)

A simple form would be k = 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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