Given a positive number x, the task is to find the natural log (ln) and log to the base 10 (log10) of this number with the help of expansion.
Input: x = 5 Output: ln 5.000 = 1.609 log10 5.000 = 0.699 Input: x = 10 Output: ln 10.000 = 2.303 log10 10.000 = 1.000
- The expansion of natural logarithm of x (ln x) is:
- Therefore this series can be summed up as:
- Hence a function can be made to evaluate the nth term of the sequence for 1 ≤ x ≤ n
- Now to calculate log10 x, below formula can be used:
Below is the implementation of the above approach:
ln 5.000 = 1.609 log10 5.000 = 0.699
- Sum of N terms in the expansion of Arcsin(x)
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Sum of the Tan(x) expansion upto N terms
- Program to print binomial expansion series
- Middle term in the binomial expansion series
- Find the value of max(f(x)) - min(f(x)) for a given F(x)
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n
- Find 2^(2^A) % B
- Find value of (1^n + 2^n + 3^n + 4^n ) mod 5
- Find (1^n + 2^n + 3^n + 4^n) mod 5 | Set 2
- Find K such that |A - K| = |B - K|
- Find the value of f(n) / f(r) * f(n-r)
- Find sum of the series 1-2+3-4+5-6+7.......
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- Find x, y, z that satisfy 2/n = 1/x + 1/y + 1/z
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.