I am trying to make the Blinn-Phong BRDF conserve energy exactly. During the course of this, I have reduced part of the problem to the following integral (D and m<0 are constants w.r.t. the variable of integration):I=∫2π0(cos(θ)+D)mdθThis turns out to be a surprisingly difficult integral. WolframAlpha, for example, gives a mess for the indefinite integral, and doesn't even output anything for the definite integral.
How can I solve this?
Please note: as above, m<0. Also, while ideally m is a real number, making m an integer is an acceptable restriction.
Answer
In my calculations, I replaced m by α since it is more like a real number! We have these assumptions only
D,α∈RD>1
First of all you can simplify your integral a little
I=∫2π0(cosθ+D)αdθ=∫π−π(cosθ+D)αdθ=2∫π0(cosθ+D)αdθ=2Dα∫π0(1+cosθD)αdθ
Now I make use of the binomial series
(1+x)α=∞∑n=0(αn)xnwhich uniformly converges when|x|<1(αn)=n−1∏i=0(α−i)n!=α(α−1)...(α−n+1)n!
considering this we can write
(1+cosθD)α=∞∑n=0(αn)(cosθD)n
but (3) converges uniformly for all θ since D>1 and hence the condition for uniform convergence |cosθD|<1 is satisfied identically. Uniform convergence of (3) let us to integrate it term by term. Accordingly, we can write
I=2Dα∫π0[∞∑n=0(αn)(cosθD)n]dθ=2∞∑n=0[(αn)Dα−n(∫π0cosnθdθ)]
Again I repeat that interchanging summation and integration in (4) holds due to the uniform convergence of the binomial series. I just leave the computation of ∫π0cosnθdθ for you which is not a hard task to carry out. I think it is the best you can obtain for this!
Cheers! :)
No comments:
Post a Comment