Thread: problem c++

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    problem c++

    i have this problem:your task is to approximate numerically the derivative of a given function f:R->R at some value x .the value for x will be input by the user (and can vary).the function f should be treated as a c++ function,for examble the user should be able to change it by editing the programme.
    a) write a c++ computer progrmme to carry out this numerical approximation
    b) run your c++ programme to approximate the following derivatives:
    1. f(x)=sinxcosx at x= 60 moirai
    2. f(x)=ln(x^2 + x^4 ) at x=3

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    two things...

    Post your code, no matter how small so you can show you have attempted to question in hand

    Nobody here will write your program for you, read the rules and regulations for more on this or read the homwork sticky thread ot the top of the page.

    If you show you have attempted it and are still stuck, we can point out where you have gone wrong and give advise on how to fix it

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    sin() and cos() are in <cmath>; you use * instead of x for multiplication in C++. (x looks like a variable.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM