Maths Tools for Cognitive Scientists Lab 2 (Week 3)

Part b

http://www.informatics.sussex.ac.uk/users/bg22/mtcs/mtcs2b.html

  1. Rules for differentiation: addition.  

    The derivative of the sum of two functions is simply the sum of the derivatives of each function:

    (The rule also applies to subtraction.)

    For example if f(x) = x2  and g(x) = 3x then d(f+g)/dx = 2x + 3.

    Plot the following functions:

    Now calculate their derivatives and plot the functions and their derivatives together.

     

  2. Rules for differentiation: products.

    The derivative of the product of two functions is:

    For example if f(x) = x2 and g(x) = sin(x) then d(f * g)/dx = [ 2x*sin(x) ] + [ cos(x)*x2 ]

    What are the derivatives of the following products?

     

  3. Rules for differentiation: the chain rule:

    If a function is applied to the result of another function (composite function) then the chain rule can be applied:

    For example if f(x) = (x2 + 3)4 then f{g(x)} = g(x)4 (where g(x) = x2 + 3)

    Therefore df/dg = 4(x2 + 3)3 and dg/dx = 2x so d(f{g(x)})/dx = 4(x2 + 3)3 * 2x.

    Plot the following curve between x values -2 and +2:

  4. Now calculate the derivative and plot its curve on the same figure.

     

     

  5. Rules for differentiation: partial derivatives.

    If a function has more than one variable then partial derivatives are found for each variable
    while the other variables are held constant. 

    For example given a function of x and y :

    f(x,y) = x2 sin(y) 

    The partial derivative of the function with respect to x (considering y to be a constant value) is:

    And the partial derivative with respect to y (consider x to be of constant value):

    Find the partial derivatives of x, y and z in the following function:

  6.  

  7. Optional: derivative of the logistic sigmoid

    The logisitc sigmoid function shown below has a very simple derivative if
    defined in terms of itself.

    Find the derivative dy/dx of this function and express your answer
    in terms of y.

    Some helpful hints: