Sum of N terms in the expansion of Arcsin ( x ) | C ++ implementation of the approach ; Function to find the arcsin ( x ) ; The power to which ' x ' is raised ; Numerator value ; Denominator value ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void find_Solution ( double x , int n ) { double sum = x , e = 2 , o = 1 , p = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { p += 2 ; sum += ( double ) ( o / e ) * ( double ) ( pow ( x , p ) / p ) ; o = o * ( o + 2 ) ; e = e * ( e + 2 ) ; } cout << setprecision ( 10 ) << sum ; } int main ( ) { double x = -0.5 ; if ( abs ( x ) >= 1 ) { cout << " Invalid ▁ Input STRNEWLINE " ; return 0 ; } int n = 8 ; find_Solution ( x , n ) ; return 0 ; }