About Jonathan Shock

I'm a lecturer at the University of Cape Town in the department of Mathematics and Applied Mathematics. I teach mathematics both at undergraduate and at honours levels and my research interests lie in the intersection of applied mathematics and many other areas of science, from biology and neuroscience to fundamental particle physics and psychology.

Using polynomials to solve differential equations

One of the aims of MAM1000W isn’t just to teach you individual mathematical topics, but over time to allow you to see the links between these subjects. Sometimes we do this explicitly, and sometimes you should notice the connections yourself simply by seeing one topic pop up in the middle of another. As I’ve written before, so much of it is about noticing patterns.

Today in class I gave a differential equation which wouldn’t be solvable by any of the methods we have looked at.

y''(x)+\cos(x)y'(x)+e^xy(x)=x^2

This is second order linear but its coefficients are not constant. We don’t have any way in to solve this. We actually wanted to solve this with the initial conditions y(0)=1 and y'(0)=-1.

Actually, that’s a lie. We didn’t want to solve it, but we wanted to get an approximation for the solution close to x=0. This is like saying: OK, so we have a differential equation for population dynamics, or climate change, or the heating of an object, and we don’t worry too much about the very far future, but we want to know what it’s going to do in the short term.…

By | October 15th, 2018|Uncategorized|1 Comment

Shuttleworth Postgraduate Scholarship Programme

ShuttleworthPostGradScholarship_UCT

How clear is this post?
By | August 23rd, 2018|Uncategorized|0 Comments

How Behavior Spreads: The Science of Complex Contagions, by Damon Centola, a review

NB. This book was sent to me as a review copy.

 

The idea of this book is relatively simple, but the consequences are huge, and in fact some of the ideas are far more subtle and complex than they may first appear.

Essentially this book is based on a series of experiments which Damon Centola has run, which are all related to changes in behaviour which can be tracked, and made to occur, through a social network (in the broadest sense of the word). This is the study diffusion in a network.

The fundamentals of the research lie on two distinctions: One in the complexity of a contagion/behaviour, meaning how many connections with others who have the contagion/behaviour do you need until you adopt it, and the other in the topology of the social network, meaning loosely, how much like a street where each person only talks to their neighbours, versus a small world-network where there are a lot of disparate connections does the network look like.…

By | August 21st, 2018|Book reviews, Reviews|2 Comments

Why did we choose that range for theta when doing trig substitutions?

Remember when we are doing a trig substitution, for instance for an integral with:

 

\sqrt{a^2-x^2}

 

We said that we should choose x=a\sin\theta, which seemed reasonable, but we also said that -\frac{\pi}{2}\le\theta\le\frac{\pi}{2}. Where did this last bit come from?

Well, we want a couple of things to hold true. The first is that any substitution that we make, we have to be able to undo. That is, we will substitute x for a function of \theta but in the end we need to convert back to x and so to do that we have to be able to write the inverse function of, in this case x=a\sin\theta. The \sin function is itself not invertible because it’s not one to one, so we have to choose a range over which it is one to one. We could choose -\frac{\pi}{2}\le\theta\le\frac{\pi}{2} or we could choose \frac{\pi}{2}\le\theta\le\frac{3\pi}{2} (amongst an infinite set of possibilities). That would also be invertible. However, remember that we are going to end up with a term of the form:

 

\sqrt{1-\sin^2\theta}=\sqrt{\cos^2\theta}

 

So if we want this to simplify, we had better choose our range of \theta such that \cos\theta is positive, so that we can write \sqrt{\cos^2\theta}=\cos\theta.…

By | August 2nd, 2018|Courses, English, First year, MAM1000, Undergraduate|2 Comments

Integrals with sec and tan when the power of tan is odd

We went through an example in class today which was

 

\int tan^6\theta \sec^4\theta d\theta

 

In this case we took out two powers of sec and then converted all the other \sec into $latex\ tan$, which left a function of tan times sec^2\theta d\theta. We wanted to do this because the derivative of \tan is \sec^2 and so we can do a simple substitution. If we have an odd power of \tan, we can employ a different trick. Let’s look at:

 

I=\int \tan^5\theta\sec^7\theta d\theta.

 

Here, sec is an odd power and so we can’t employ the same trick as before. Now we want to convert everything to a function of \sec and have only a factor which is the derivative of \sec left over. The derivative of \sec is \sec\tan, so let’s try and take this out:

 

I=\int \tan^5\theta\sec^7\theta d\theta=\int \tan^4\theta\sec^6\theta (\sec\theta\tan\theta)d\theta.

 

Now convert the \tan into \sec by \tan^2\theta=\sec^2\theta-1:

 

I=\int (\sec^2\theta-1)^2\sec^6\theta (\sec\theta\tan\theta)d\theta=\int (\sec^{10}\theta-2\sec^8\theta+\sec^6\theta) (\sec\theta\tan\theta)d\theta

 

where here we have just expanded out the bracket and multiplied everything out.…

Fundamental theorem of calculus example

We did an example today in class which I wanted to go through again here. The question was to calculate

 

\frac{d}{dx}\int_a^{x^4}\sec t dt

 

We spot the pattern immediately that it’s an FTC part 1 type question, but it’s not quite there yet. In the FTC part 1, the upper limit of the integral is just x, and not x^4. A question that we would be able to answer is:

 

\frac{d}{dx}\int_a^{x}\sec t dt

 

This would just be \sec x. Or, of course, we can show that in exactly the same way:

 

\frac{d}{du}\int_a^{u}\sec t dt=\sec u

 

That’s just changing the names of the variables, which is fine, right? But that’s not quite the question. So, how can we convert from x^4 to u? Well, how about a substitution? How about letting x^4=u and seeing what happens. This is actually just a chain rule. It’s like if I asked you to calculate:

 

\frac{d}{dx} g(x^4).

 

You would just say: Let x^4=u and then we have:

 

\frac{d}{dx} g(x^4)=\frac{du}{dx}\frac{d}{du}g(u)=4x^3 g'(u).…

Calculus for the ambitious, by Tom Korner, a review, by Henri Laurie

Amazon link

This is a lovely book: strong emphasis on ideas; a lively sense of humour; a sure logical touch; historical detail that is accurate, relevant, yet quirky (takes some doing!). What’s not to like?

Well, there’s this: it is not easy to decide whether to recommend the book to anybody who doesn’t already know calculus. I’ll return to that. Let me start by describing why this is such a good book.

Firstly, the light touch and the clarity, which together make it wonderfully accessible. Fans of Tom Korner, including yours truly, will be happy to hear that it it as good as his “The Pleasures of Counting” and “Fourier Analysis”, two of the best books on maths ever. Like them, it discusses applications, social context and history but always in a way that supports the maths, which remains the main focus.

Secondly, the balance between rigour and intuition is superbly judged and maintained.…

By | June 20th, 2018|Book reviews, Reviews|0 Comments

The Recamán sequence

In case you have watched the following video about the Recamán sequence.

and want to play around with it in Mathematica. Here is my code for doing so:

nums = {0};

For[i = 1, i < 66, i++,
If[nums[[-1]] – i > 0 && Position[nums, nums[[-1]] – i] === {}, nums = Append[nums, nums[[-1]] – i],
nums = Append[nums, nums[[-1]] + i]]
]

{{#[[1]], 0}, #[[2]]} & /@ Partition[Riffle[Mean[#] & /@ Partition[Riffle[nums, nums[[2 ;;]]], 2],
Abs[Differences[nums]]/2], 2];

Show[Show[
Table[Graphics[Circle[%[[i, 1]], %[[i, 2]], {(i) \[Pi], (i + 1) \[Pi]}]], {i, Length[%]}], ImageSize -> 1000], Plot[0, {x, 0, 91}],
Axes -> True]

(You may have to copy this by hand rather than copy/paste.)

This produces the following rather beautiful graphic (and answers the question posed in the video):

RecamanEvidence away my dear Watson…evidence away.

How clear is this post?
By | June 14th, 2018|Uncategorized|0 Comments

Music by the Numbers, From Pythagoras to Schoenberg – By Eli Maor, a review

NB. I was sent this book as a review copy.

Music by the numbers leads us on a journey, as stated in the title, from Pythagoras to Schoenberg. In many ways the endpoint is stated early on, giving us clues that a revolution in mathematical thinking about musical scales will be encountered in the early twentieth century. Indeed the journey through musical practice, mathematics, physics and the biology of hearing is woven rather beautifully together, giving the account of our step by step explorations of tonal systems and their links to the physics of vibration. The development of calculus and the triumph of Fourier take as from the somewhat numerological and empiric realms of musical experimentation to the age of a true understanding of timbre – the way different instruments express harmonics and their overtones in different admixtures. A lot of emphasis is placed on the development of scales based on subtly different frequency ratios, which were developed over the years (particularly within European music, non-European music being given only very brief comment) to balance the physical, mathematical and aesthetic qualities of the various possible tunings of instruments.…

By | June 2nd, 2018|Book reviews, Reviews|1 Comment

Kovalevskaia research grants for female mathematicians in Southern African region

KovaleskaiaAward2018

How clear is this post?
By | May 28th, 2018|Advertising|0 Comments