# Integrate returns function which wrongly contains singularities at certain parameters

I am trying to generate a function that represents essentially a Beta Distribution that revolved around the Y axis. To do this I am trying to integrate only one quadrant because the expansion from that is trivial. To do this I am using the following code:

\$Assumptions=0<x<1 && \[Alpha]>1 && \[Beta] >1&&x<R<1;
dy=D[Sqrt[R^2-x^2],R]
CurveFunc=dy*R^(\[Alpha]-1)*(1-R)^(\[Beta]-1)/Beta[\[Alpha],\[Beta]];
CurvePDF=Expand[Integrate[CurveFunc,{R,x,1} ]]


This produces the following Integral with primarily made up with hypergeometric functions:

But a quick review of that function and you will see that it is undefined or singular at Integer values of [Alpha]. Which is incorrect because if you substitute in an integer value of [Alpha] before hand it will produce a valid return ie:

CurvePDF=Expand[Integrate[CurveFunc/.\[Alpha]->6,{R,x,1} ]]


Will return a function that is continuous. I would like to find the generic integral that works for all real Alpha > 1. Does anyone have an idea how to get Mathematica to produce an integral without those singularities?

• Typically, solutions of this sort are "generically correct"; that is, they are valid except on a countable subset of parameter values. Unfortunately, those values (e.g. the integers) are often the values of interest in applications. – J. M. is away Apr 11 '17 at 13:44
• I have tried including the assumption that Alpha is an integer but it still produces the same always invalid result for that version. – N D Apr 11 '17 at 13:49

## 1 Answer

When you calculate the integral for certain values of alpha and have a close look at the results, you can extract a general rule for Integer-alphas:

 int11[r_ /; r > 1 && EvenQ[r]] = (-1)^(r/2) 1/
Beta[r, \[Beta]] 2^-\[Beta] Sqrt[\[Pi]] Gamma[\[Beta]] MeijerG[{{1/
2}, {(r + \[Beta])/2, (r + 1 + \[Beta])/2}}, {{0,
r/2}, {(r + 1)/2}}, x^2]

int11[r_ /; r > 1 && OddQ[r]] = (-1)^((r - 1)/2) 1/
Beta[r, \[Beta]] 2^-\[Beta] Sqrt[\[Pi]] Gamma[\[Beta]] MeijerG[{{1/
2}, {(r + 1)/2 + \[Beta]/2, (r + \[Beta])/2}}, {{0, (r + 1)/
2}, {r/2}}, x^2]


Here the test

    Table[
int11[j] ==
Expand[Integrate[CurveFunc /. \[Alpha] -> j, {R, x, 1}]] //
Simplify, {j, 2, 15}]

(*   {True, True, True, True, True, True, True, True, True, \
True, True, True, True, True}    *)

Plot[CurvePDF /. {\[Beta] -> 2.2, x -> .1}, {\[Alpha], 1, 15},
PlotRange -> All,
Epilog ->
Point[Table[{\[Alpha],
int11[\[Alpha]] /. {\[Beta] -> 2.2, x -> .1}}, {\[Alpha], 2,
15}]], AxesLabel -> {\[Alpha],
"CurvePDF/.{\[Beta]\[Rule]2.2,x\[Rule].1}"}]