Author Topic: Confessions of an Alpha-Numerically Hypnotized Number-Crunching Consciousness  (Read 2592 times)

0 Members and 1 Guest are viewing this topic.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
  /*
    Introductory Analysis
    Chapter 6, section 1 : Exercises 1 and 2 SPECIAL VERSION using pair
    and bindings C++17 (-std=c++17):
     for (const auto & [f, eq] : Functions)
   
     g++ -g -Wall function_pair_++17.cpp -std=c++17 -o analyze_pair++

     enscript -1rG --portrait --line-numbers -p function_pair++.ps
               --highlight=cpp -c function_pair_++17.cpp

    Mike Hentrich   18 February 2020
 
  1. Write and run a program to approximate the slope of
     the line tangent to the graph of the function f(x) = x^3
     for input values of x.
     
     Use the formula S(x) = ( f(x + h) - f(x) ) / h
     with h = 1, 0.1, 0.01. 0.001. and 0.0001

  2. Modify and run the program in Exercise 1 for each function.
     (a)   f(x) = -x^2
     (b)   f(x) = 4*x
     (c)   f(x) = x^3 - 2*x

6-3:   25, 22, 21:
   Modify and run the program in Exercise 1 for each function. // use std::pow
     (a)   f(x) = (1-x)^(-1)
     (b)   f(x) = (1-x)^2
     (c)   f(x) = (1+x)^2
 
  NOTE:

  double(*f)(double x)
  The above tells the compiler that the parameter f is a pointer to a function.
  The pointed-to function takes a double input and returns a double.
  */
« Last Edit: February 19, 2020, 07:47:37 am by mudslide mic »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~