# Numerical solution to integration of function which parameters define the integral limits

I have following equation:

$\int^{\delta_c}_{\delta_c-\pi}\sqrt{h^2_c(\cos(\delta_c)^2-\cos(\delta)^2+\Omega_c(\delta_c-\delta)}\text{d}\delta=\pi$,
where $\delta_c=\frac{1}{2}\arcsin\left(\frac{\Omega_c}{h^2_c}\right)$ and I want to make a $\Omega_c(h_c)$ plot.

I have tried to solve it via NIntegrate and NSolve.

function[a_, b_, \[Delta]_] := NIntegrate[Sqrt[b(Cos[1/2 ArcSin[a/b]]^2 - Cos[\[Delta]]^2) + a (1/2 ArcSin[a/b] - \[Delta])], {\[Delta], 1/2 ArcSin[a/b] - \[Pi], 1/2 ArcSin[a/b]}]

NSolve[function[a, 0.1, \[Delta]] == \[Pi], a, Reals]

• If you have tried something, please add it to the question. You're significantly more likely to get help if people don't have to redo all the things you did (starting already from copying the equation into MMA by hand, as there's no code for it) Commented Jun 13, 2018 at 10:43
• conflict: Functionparameter \Delta and integrationvariable \Delta. You should omit the parameter in the functiondefinition. Commented Jun 13, 2018 at 11:20

function[Ω_?NumericQ, h_?NumericQ] :=

I used Method -> "AdaptiveQuasiMonteCarlo" in NDSolve,because is fast.
ContourPlot[function[Ω, h] == Pi, {h, -2, 2}, {Ω, -1/10, 1}, FrameLabel -> Automatic,