I = ∫Sqrt[(x-a)/(b-x)]dx
= ∫Sqrt[x-a]/Sqrt[b-x]dx
= ∫Sqrt[x-a]/Sqrt[(a - x) + (b - a)]dx
Now set u = Sqrt[x-a]
du = dx/(2Sqrt[x-a]) = dx/(2u)
dx = 2udu
Thus the integral becomes (noting that u2 = x - a)
I = ∫u/Sqrt[-u2 + (b - a)] * (2udu)
=2∫u2/Sqrt[-u2 + (b - a)]du
Setting K2 = b - a [For simplicity, we'll see how this unwinds ...]
And you get a nice integral to to by parts twice:
*Aside note: Why does b > a for this particular method to work?*
I = 2∫u2/Sqrt[K2 - u2]du
Now we could do a nice substitution of u = Kcos[t] or some such, but I hate subs. Well let's delay it by 1 step in any case
Expanding the above we find:
I/2 = ∫[u2 - K2 + K2]/Sqrt[K2 - u2]du
=∫[u2 - K2]/Sqrt[K2 - u2]du + ∫K2/Sqrt[K2 - u2]du
Note that the second sum is a standard integral, evaluating to:
K2 * Sin-1[u/K]
Thus we have [by subtraction]:
I/2 - K2 * Sin-1[u/K]
= - ∫Sqrt[K2 - u2du
Now we substitute, u = Kcos[t]
du = -Ksin[t]dt
And:
I/2 - K2 * Sin-1[u/K]
= -∫Ksin[t] * (-Ksin[t]dt)
CRAP THIS WASN'T EASIER [I'd still be doing the same thing ... oh well, I'll catch a break soon]
Thus we have:
(I/(K2) - 2Sin-1[u/K])
=∫2sin2[t]dt
Now how the hell do you do a sin squared integral... Oh yeah...
(I/(K2) - 2Sin-1[u/K])
=∫(1 - cos[2t])dt
=t - sin[2t]/2 + C1
Now for some hectic rearrangement, gives us:
t = cos-1[u/K] = cos-1[Sqrt[(x-a)/(b-a)]]
sin[2t] = 2sin[t]cos[t]
= 2Sqrt[1 - cos2[t]]cos[t]
= 2Sqrt[1 - u2]u
= 2sqrt[1 - x - a]Sqrt[x - a]
So we've got:
(I/(K2) - 2Sin-1[u/K])
= cos-1[Sqrt[(x-a)/(b-a)]] - sqrt[1 - x - a]Sqrt[x - a] + C1
Ok, this is literally the worst solution ever.
I/K2
= 2Sin-1[Sqrt[(x-a)/(b-a)]] + cos-1[Sqrt[(x-a)/(b-a)]] - sqrt[1 - x - a]Sqrt[x - a] + C1
Thus:
I = (b - a) * [2Sin-1[Sqrt[(x-a)/(b-a)]] + cos-1[Sqrt[(x-a)/(b-a)]] - sqrt[1 - x - a]Sqrt[x - a] + C1]
Yeah, that doesn't even look right. Someone find the error, I'm not liking the sqrt[1 - x - a] term, [it doesn't fit in]