First poly(x)-a0 is set in foo1. The constant term a0 can be removed from poly in the following argument, but only be added in logexppoly later.
![[Graphics:../Images/index_gr_146.gif]](../Images/index_gr_146.gif)
Make rule "rulepoly" to substitute "poly" for foo1.
![[Graphics:../Images/index_gr_148.gif]](../Images/index_gr_148.gif)
Considering
![[Graphics:../Images/index_gr_149.gif]](../Images/index_gr_149.gif)
we can calculate as follows, and stored in foo4 up to
terms.
![[Graphics:../Images/index_gr_153.gif]](../Images/index_gr_153.gif)
![[Graphics:../Images/index_gr_154.gif]](../Images/index_gr_154.gif)
Then, we take the expectation of foo4, calculating , and stored in foo5 below.
![[Graphics:../Images/index_gr_157.gif]](../Images/index_gr_157.gif)
![[Graphics:../Images/index_gr_159.gif]](../Images/index_gr_159.gif)
![[Graphics:../Images/index_gr_161.gif]](../Images/index_gr_161.gif)
Considering
![[Graphics:../Images/index_gr_163.gif]](../Images/index_gr_163.gif)
we take the log of foo5, and stored in foo8 up to terms below.
![[Graphics:../Images/index_gr_166.gif]](../Images/index_gr_166.gif)
![[Graphics:../Images/index_gr_167.gif]](../Images/index_gr_167.gif)
![[Graphics:../Images/index_gr_168.gif]](../Images/index_gr_168.gif)
This is logeexppoly for b=0.
![[Graphics:../Images/index_gr_170.gif]](../Images/index_gr_170.gif)
The following expression may be easier to read for us, but violating the summation convention rule of subscripts.
![[Graphics:../Images/index_gr_172.gif]](../Images/index_gr_172.gif)