Closed Thread
Results 1 to 4 of 4

Thread: Derivative

  1. #1
    mia's Avatar
    mia
    mia is offline Newbie
    Join Date
    Jul 2009
    Posts
    2
    Rep Power
    0

    Derivative

    Hi!
    I new in this forum, so if this thread already exsist, you can delete this post.

    I would like to do a console application in Delphi which will calculate derivatives of polynoms. Does anybody already done something like that? I write a code in Delphi which seperate polynom and save all numbers, but now I don't know how to calculate this thing. Can anybody help me?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,489
    Blog Entries
    75
    Rep Power
    143

    Re: Derivative

    It will depend a little on how you're saving the polynomial. If you save a term "5x^7" as a pair (5,7), then the derivative of that term would be the pair (5*7,7-1) = (35,6)
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    mia's Avatar
    mia
    mia is offline Newbie
    Join Date
    Jul 2009
    Posts
    2
    Rep Power
    0

    Re: Derivative

    The input is given like that (x^2+3x+1), and then I save 2,3 and 1. Now I don't know how to derivate this in Delphi. I know that the solution is (2x+3) but I don't know how to write this in Delphi.

  5. #4
    Join Date
    Jul 2006
    Posts
    16,489
    Blog Entries
    75
    Rep Power
    143

    Re: Derivative

    Why would you save it as 2,3,1 instead of 1,3,1?

    If you save the coefficients in an array, where the coefficient is in the position where the index is the power on x, then you would have:
    poly[2]=1
    poly[1]=3
    poly[0]=1

    Then:
    deriv[1]=poly[2]*2
    deriv[0]=poly[1]*1
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to find derivative in java
    By sania21 in forum Java Help
    Replies: 1
    Last Post: 05-15-2007, 04:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts