Sinx= x- (x3/3!)+ (x5/5!)- (x7/7!)+.......

I can't solve it

Please help me........

Jump to PostThat is the taylor series for sin(x) i.e. sin(x) is approximately x- (x3/3!)+ (x5/5!)- (x7/7!)+.......

What do you want to solve?

Jump to Postx can be written as (x^1)/1! Now it's in the same form as the other terms, x^exponent/exponent!, except that you need a mechanism to flip the sign from positive to negative, which can be done by using -1^(exponent - 1) with each term. now use a loop to add each …

SasseMan
49
Junior Poster

That is the taylor series for sin(x) i.e. sin(x) is approximately x- (x3/3!)+ (x5/5!)- (x7/7!)+.......

What do you want to solve?

Lerner
582
Nearly a Posting Maven

x can be written as (x^1)/1! Now it's in the same form as the other terms, x^exponent/exponent!, except that you need a mechanism to flip the sign from positive to negative, which can be done by using -1^(exponent - 1) with each term. now use a loop to add each term one to the other in sequence and decide what level of sensitivity you want to use to decide when to stop.

Looking for patterns is part of the fun!

Edited
by Lerner because:
*
n/a *

Taywin
312
Posting Virtuoso

Lerner
582
Nearly a Posting Maven

That's great, if you remember the equation. But brute force is what computers do best, so I don't mind utilizing their strength. To expect someone to come up with the equation on their own would be a ludicrous learning experience as part of a class and a wonderful "AHA!" moment if you were a mathematician.

N.B I see my protocol for flipping the sign every other term needs to be tweaked, but you get the idea of what can be done to accomlish the task.

Edited
by Lerner because:
*
n/a *

Taywin
312
Posting Virtuoso

I cannot recall because I have not used it for a long time, but it should be an equation related to harmonic equation approximation.

By the way, it is depends on how precise you want for your result. Brute force is not the best to go for even with computer because how would you know that it is 'good enough' result? It is the same as 'how many times would you test your program and can say that it is good enough?' If there is an equation which someone has already implemented that can be applied to your problem, why don't you search for it? I just give him an information. If you have the Internet, why wouldn't you utilize it? Or you just use it for gaming?

Edited
by Taywin because:
*
n/a *

Sohelp
0
Newbie Poster

Thanks to all of you

I understood how to solve this type of problem.

So again i say Thanks for your help

Your Regards

Sohel Rana

Bangladesh

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.