Total Soma Membrane Potential (Tsmp) Calculation

Need some help currently on interpreting if the formulas I am using and
getting from Mathematica are correct.  It seems I am doing something
wrong and I am trying to figure out the right formulas.  In this code I
have tried implementing the formula I got from mathematica as shown in
the following link: http://i.imgur.com/4z0efXD.jpg
Some things in particular I recognize are that the K and K2 variables
each being 'summation index of symbolic sum' seem that I am not
implementing them right.  I am somehow not implementing Matlab's integral 
function right as well.  I will try to reach out to sources to get help
on this but any other help I can get is greatly appreciated.