# How to solve boundary value problem?

Is it possible to solve a boundary value problem like this?

f1[y_?NumericQ] :=
NIntegrate[
Sqrt[t + (0.001686429/2) t^2]/(1 + Exp[t - y]), {t, 0, Infinity},
MaxRecursion -> 100]
f2[y_?NumericQ] :=
NIntegrate[
t Sqrt[t + (0.001686429/2) t^2]/(1 + Exp[t - y]), {t, 0, Infinity},
MaxRecursion -> 100]


and,

sol = NDSolveValue[{X''[x] +
4*\[Pi]*0.0072971432*
x*(2.28986112*^-8)^3*(((3/(4*\[Pi]))*
HeavisideTheta[
4.16095*10^-8 - x]) - ((Sqrt[
2]/\[Pi]^2)*(0.0037851841)^3*(0.001686429)^(
3/2)*(f1[X[x]/x] + (0.001686429*(f2[X[x]/x]))))) == 0,
X[10^-20] == 0,
X'[0.00002096185] == X[0.00002096185]/0.00002096185},

X, {x, 10^-20, 0.00002096185}];


then,

Plot[sol[x], {x, 10^-20, 0.00002096185}]
{sol[0.00002096185], sol'[0.00002096185]}


But it is not giving a desired answer. can anyone help?

• This code evaluates and gives consistent results, i.e., {X[10^-20] == 0, X'[0.00002096185] == X[0.00002096185]/0.00002096185} /. X -> sol evaluates to {True, True} What exactly doesn't work and what is the "desired answer"? Feb 25 at 13:48
• but it should not give constant value. It looks like it is showing some numerical error. the function is not that simple
– AKU
Feb 25 at 13:50
• How about Plot[sol[x], {x, 10^-20, 0.00002096185}, WorkingPrecision -> 20]? Feb 25 at 13:58
• it is behaving like X[x]=x but it does not look that simple. I am not sure if this is the correct way to evaluate it or not.
– AKU
Feb 25 at 14:01
• sol is not a constant, merely linear. If you suspect a precision issue, convert everything to using arbitrary-precision rather than machine precision. Looks like same result. Feb 25 at 14:16