I want to integrate this integral $$\int_0^{\pi}d \theta\sin ^{d-2}(\theta ) \left(-1+e^{i k x \cos (\theta )}\right)$$ So first I tried
Integrate[(E^(I k2 x Cos[\[Theta]]) - 1) Sin[\[Theta]]^( d - 2),
{\[Theta], 0, \[Pi]}, Assumptions -> x > 0 && k2 > 0 ]
which came back nothing. Then I tried
Integrate[(E^(I k2 x Cos[\[Theta]]) - 1) Sin[\[Theta]]^( d),
{\[Theta], 0, \[Pi]}, Assumptions -> x > 0 && k2 > 0 ]
the result was
ConditionalExpression[(Sqrt[\[Pi]] Gamma[(1+d)/2] (-1
+Hypergeometric0F1[1+d/2,-(1/4) k2^2 x^2]))/Gamma[(2+d)/2],Re[d]>-1]
Why didn't the first one work?
If I add another assumption
Integrate[(E^(I k2 x Cos[\[Theta]]) - 1) Sin[\[Theta]]^( d - 2),
{\[Theta], 0, \[Pi]}, Assumptions -> x > 0 && k2 > 0 && d>1]
the result looks normal but why can't mma guess the condition $d>1$ in the first integration?
Integrate[(E^(I k2 x Cos[\[Theta]]) - 1) Sin[\[Theta]]^(d - 2), {\[Theta], 0, \[Pi]}, Assumptions -> x > 0 && k2 > 0]
Result:ConditionalExpression[(1/Gamma[d/2]) Sqrt[\[Pi]] Gamma[1/2 (-1 + d)] (-1 + Hypergeometric0F1[d/2, -(1/4) k2^2 x^2]), Re[d] > 1]
$\endgroup$