Tuesday, March 12, 2019

integration - Integrate (cos(theta)+D)m (power of cosine plus constant)



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)=n1i=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θ=2n=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

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...