This is how you get from your first equation to your second.
your utility function is u(x1,x2)=xa1xb2
since a+b=1 I'll change it slightly to a and (1-a)
In order to optimise these two choices, you need to maximise utility, wrt your choice variables.
subject to p1x1+p2x2=w
using Walras Law. Basically, in order to optimise utility, all money will be spent.
Cobb-Douglas functions are typically difficult for optimisation problems. A monotonic transformation which preserves the ordinal properties of the function can be used.
aln(x1)+(1−a)ln(x2)
This will be used instead. The same budget constraint will be applied.
The Lagrange and First Order Conditions are Below
L=aln(x1)+(1−a)ln(x2)−λ(w−p1x1−p2x2)
δLδx1=ax1−λp1=0
δLδx2=1−ax2−λp2=0
manipulating the First order conditions result in
λ=ax1p1
λ=(1−a)x2p2
ax1p1=(1−a)x2p2
substituting in the budget constraint p2x2=w−p1x1
ax1p1=(1−a)w−p1x1
x1=wap1
and
p1x1=w−p2x2
aw−p2x2=(1−a)p2x2
w=a(1−α)p2x2+p2x2
w(1−a)=p2x2
x2=w(1−a)p2
Using these results, we can work out the optimal consumption bundles of x1 and x2 for a given price, wealth combination.
x1=wap1
x2=w(1−a)p2