Sum and Table - Challenge Question

One often frustrating part of programming is finding errors in the code. It can often descend into a fruitless game of ‘Where’s Wally’ (or Waldo if you are from North America).

Some useful strategies for finding errors include:
1. Reduce the code to the bare-bones. In particular, delete any sections of the code that are not essential e.g. don’t include options that give the graph a certain colour. Removing these removes possible sources of error. 
2. Divide and conquer. Systematically test each part of the code, starting with the most basic building blocks. Compare what you have written with the help file. 

Use this method to correct the code below in order to reproduce the image shown below. You will also need to add in labels for the axes and the plot.

Table[Plot[{Cos[n*x*π](*wave 1 - variable period*),Sin[π*x](*wave 2 - constant period*),Cos[n*x*π]+Sin[π*x](*Superposition of waves 1 and 2*)},{x,0,2π},(*Options: *)PlotRange->All,PlotStyle->{{Red,Dotted},{Blue,Dotted},{Black,Thick}},ImageSize->600,PlotLegends->"Expressions"],{n,1,5}]

Image: