I have an integral without a closed form answer and is given by,
$$a = c z_s^{d+1}\int_0^1 dx \frac{x^d}{\sqrt{(1-(z_s/z_h)^{d+1} x^{d+1})(1-c^2 z_s^{2d} x^{2d})}} \tag{1}\label{1}$$
where $a$, $z_s$, and $z_h$ are constants which can be assigned a value ($0 \leq a, z_s \leq 10$, $z_h=10$), $c=c(z_s)$ is an unknown function of $z_s$ which I need to determine from $\eqref{1}$.
After determining $c(z_s)$ in terms of $z_s$ I will plug that into the expression $S$ given by,
\begin{align} S &= \frac{1}{4 z_s^{d-1}}\Bigg(1 -\frac{\sqrt{(1-c^2 z_s^{2d})(1-b^{d+1})}}{d-1} + \frac{2d-1}{d-1} c^2 z_s^{2d} \int^1_0 dx x^d \sqrt{\frac{(1-(b x)^{d+1})}{(1-c^2(z_s x)^{2d})}}\\ & -\frac{b^{d+1}(d+1)}{2(d-1)} \int^1_0 dx x \sqrt{\frac{(1-c^2(z_s x)^{2d})}{(1-(b x)^{d+1})}}\\ & + b^{d+1}\int^1_0 dx \frac{x}{\sqrt{(1-(b x)^{d+1})(1-c^2(z_s x)^{2d})}}\Bigg) \tag{2}\label{2} \end{align}
where $b=\frac{z_s}{z_h}$.
I have tried the following code
d = 3;
zh = 10;
SeedRandom[2020];
a = RandomReal[{0, 10}];
toroot[c_?NumericQ, z_] := a - c*z^(d + 1)*NIntegrate[x^d*((1 - (z/zh)^(d + 1) x^(d + 1)) (1 - c^2*z^(2 d) x^(2 d)))^(-1/2), {x, 0, 1}]
cz[z_?NumericQ] := c /. FindRoot[toroot[c, z], {c, 0.002, 0.0000001, 10}]
ints[x_?NumericQ, z_] := With[{b = z/zh}, (((2 d - 1)/(d - 1)) cz[z]^2 z^(2 d)) x^d ((1 - (b x)^(d + 1))/(1 - cz[z]^2 (z x)^(2 d)))^(1/2) - ((b^(d + 1) (d + 1))/(2 (d - 1))) x ((1 - cz[z]^2 (z x)^(2 d))/(1 - (b x)^(d + 1)))^(1/2) + (b^(d + 1) x)/((1 - (b x)^(d + 1)) (1 - cz[z]^2 (z x)^(2 d)))^(1/2)];
intS[z_?NumericQ] := NIntegrate[ints[x, z], {x, 0.5, 1}]
functionS[z_?NumericQ] := ((-((1 - cz[z]^2 z^(2 d)) (1 - b^(d + 1)))^(1/2)/(d - 1)) + intS[z] + 1)/(4 z^(d - 1));
function[z_?NumericQ] := Log[10, functionS[z]];
Plot[function[z], {z, 0, 10}, PlotPoints -> 3, AxesLabel -> {"z", "Log S"}, PlotStyle -> {Thick, Blue}, PlotRange -> Full, ImageSize -> Large]
How should I obtain an expression or at least a numerical fit of $c(z_s)$ in terms of $z_s$ given that $\eqref{1}$ does not have a closed form? Maybe Mathematica has a way to give a relation even it is not exact, like determining the integral using approximate methods? In the end, I will plug $c(z_s)$ in $S$ and plot.
***Note: This is an updated version of my original question, I have removed the redundancies in my original post and clarified my problem.
z
(because ofb
for instance). $\endgroup$With
? $\endgroup$SetDelayed
instead of=
. $\endgroup$