function to return the sum of the series
function log_Expansion ( x , n ) { let sum = 0 ; let i = 0 ; for ( i = 0 ; i < n ; i ++ ) { sum = sum + Math . pow ( x , 2 * i ) / fact ( 2 * i ) ; } return sum ; }