# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="AgFlD2la8pJY" colab_type="text"
# ### Assignments are taken from 
#
# David Pine's book.  

# + [markdown] id="RbyONaUw8vny" colab_type="text"
# **A. Chapter 3.6 Problem 1.**
#
# Create an array of 9 evenly spaced numbers going from 0 to 29 (inclusive) and give it the variable name r. 
#
# Find the square of each element of the array (as simply as possible). 
#
# Find twice the value of each element of the array in two different ways: 
# (i) using addition and (ii) using multiplication. 
#
# Print out the array r and each output requested above.

# + id="Z-mHjP7m8zZU" colab_type="code" colab={}
Your code...............

# + [markdown] id="PpeZWt0_9BZN" colab_type="text"
# **B. Basic calculus**

# + [markdown] id="eJXjfwpw9Sl6" colab_type="text"
# Use *arange* function from NumPy to create $x$ ranging from $-2\pi$ to $2\pi$.
#
# 1. Calculate various trigonometric function such as $\sin(x), \cos(x), \tan(x)$. Let call these functions as y. 
#
# 2. Plot $x$ vs $y$, i.e., one plot for $x$ vs $\sin(x)$ etc.
#
# 3. Numerically find derivative of $y$ wrt $x$. That is for $y=\sin(x)$ answer is $\cos(x)$ and so on so forth.
#
# 4. Finally plot, numerically calculated derivative against theoretical derivative. They should look similar, right? Demonstrate.

StarcoderdataJupyterScriptsDedupFiltered