PHYS 30 First Hour Exam Spring 20 This is a closed book, closed note exam. You will not need nor be allowed to use calculators or other electronic devices on this test. Do all your writing in your blue book (s) making sure you put your name on each blue book you use. You may do questions in any order; please make sure to label clearly the question you are solving. Your answers must show clear and complete solutions; little to no credit will be given to "correct" answers that show no work. The numbers in parentheses indicate the value of the question. Some important notes: ) You may invoke symmetry arguments to evaluate integrals, but must explain how you are using symmetry (e.g., the integrand is odd/even therefore the integral evaluated between (-,) is.... 2) You must use Einstein summation notation when it is requested. No credit will be given for explicit component-by-component analysis.. Consider the function f (x) = x 2 on the interval (0, 2). Extend this function to make it: a) an odd function, and b) an even function on (-2,2). For both parts, graph the function between (-2,2). Compute the Fourier trig coefficients for each extended function, and write out explicitly the first three non zero terms of each Fourier series. You may use symmetry arguments where appropriate to determine Fourier coefficients. (30) Solutions : In this question, I was looking to see if you could extend a function to make it even or odd, apply symmetry properly, use the correct Fourier coefficients, and recognize that the odd function will have terms of the form sin (n p x/2) and the even function will have terms of the form cos (n p x/2). a) Extend the function as an odd function, so it will look like : 2-2 - 2-2 - The function is now defined and 2 periodic on (-2, 2); thus, the value of we will use in determining coefficients and expanding our Fourier series is 2. Since this function on (-2, 2) is odd, all the
2 phys30-20firsthourexams.nb a n coefficients are zero. We can compute the b n coefficients as : b n = l f x sin n p x = 2 2-2 x^2 sin n p x 2 dx 0 where I have used the relevant expressions for and f (x). The value for this integral is given at the end of the exam : Integratex 2 Cosn p x, x 2 Sinn p x, x 2np x Cos n p x + -22 + n 2 p 2 x 2 Sin n p x, n 3 p 3 2 2 - n 2 p 2 x 2 Cos n p x + 2npxSin n p x n 3 p 3 We want the second integral now (and the first integral for part b) when we consider the even extension). Knowing that = 2, we can see that the sin term in the answer will be zero, since sin (n p) for all integer values of n is zero. Thus, our coefficients become : b n = 2 8 - n2 p 2 x 2 2 cos n p x = n 3 p 3 0 n 3 p 6-3 8n2 p 2 - n - 6 = 8 - + n 2 p 2 n 3 p 3, n odd -8 n p, n even So that the first three terms of the Fourier expansion are : f x = 8 - +p2 sin p x 2-8 p 3 2 p sin 2 p x 2 + 8 - + 9 p2 sin 3 p x 2 +... 27 p 3 b) For the even function, our graph is simply : 3 2-2 - 2 We can use symmetry to compute our coefficients :
phys30-20firsthourexams.nb 3 a 0 = 2 2 2 x 2 dx = 8 0 3 2x 2 cos n p x 2 dx = 8 2np Cosn p + -2 + n2 p 2 Sinn p a n = 2 2 0 n 3 p 3 b n = 0 by symmetry We can look at the expression for a and realize that the Sin[n p] terms will always be zero for integer values of n, leaving us with a simple expression for a n : 6 -n a n = n 2 p 2 and our Fourier series is : f x = -6 cos 2 p x 2 cos 3 p x 2 cos p x 2 - + +... 9 p 2 2. In class and for homework, you used Parseval' s theorem to evaluate sums of the form : S n= n z where z is an integer. One of the steps is to find the average value of the square of some function over an appropriately chosen interval. In class and for homework we found the sums for expressions such as S n= n 2 = p2 6 ; S n= n = p 90 ; and S n= n 6 = p6 95 by evaluating an appropriate function over (-p, p). Notice that in each case the exponent in the denominator is even. Why did we not use these techniques to find the sum of n 3 or n 5 (or any other odd power)? (Hints: Think about the technique we used to find the sums above, and from this think about the functions you would have to use and the integrals they would generate). In essence, I am asking for you to describe the practical difficulty in using standard Fourier techniques to find the sums of n odd. (20) Solution:: Parseval' s theorem relates the average of the square of a function to the square of Fourier coefficients. Thus, if our Fourier series involves coefficients of the form /n, Parseval' s theorem can generate a result for the sum of n 2. In order to sum terms like n 3, we would need to generate Fourier coefficients that vary as n -32 (so that when squared they yield n -3 ). Generating coefficients of this form would require integrals involving radicals such as:
phys30-20firsthourexams.nb In[]:= IntegrateSqrtx Cosn x, x,, Out[]= 2 FresnelS 2 n 2 n Sinn 2 2 n 32 We do generate a Fourier coefficient that depends on n -32, but this is not at all a standard or elementary integral, and the numerator of the coefficient is also n dependent, making it even more difficult to isolate S n 3. 3. Use Einstein summation notation to show that :! âaâb = A! B + B! A - A! B - B! A 30 (The notations A! and B! are correct and meaningful) Solution : First, we write the identity in summation notation :! âaâb Øe mni e ijk A j B k x n Collect e terms and permute cyclically so that the repeated index is in the same position in the permutation tensor : e mni e ijk A j B k =e imn e ijk A j B k x n x n Apply the e - d relationship : e imn e ijk A j B k = d mj d nk -d nj d mk A j B k x n x n The first set of d' s require that m = j and n = k; the second set requires n = j and m = k. Expanding and making these substitutions : d mj d nk -d nj d mk A j B k = A m B n - A n B m x n x n x n Apply the product rule to the two partial derivatives : A m B n - x n A n B m = A m B n + B n A m - A n B m - B m A n x n x n x n x n x n We have now done all our manipulation in summation notation. We have generated four terms on the right. ooking at the repeated indices (which are always n), we get for the terms respectively : A! B + B! A - A! B - B! A. Write a short Mathematica program that will, for each integer k from to 00, print out the
phys30-20firsthourexams.nb 5 In[2]:= square of the number if it is prime and the cube of the number if it is not prime. Capitalization, syntax (i.e., proper use of spacing, braces, brackets and parentheses) all count toward your grade. (20) Solution : You can do this several ways (I will print set the upper limit to 5 to truncate the output). As a Do oop : DoIfPrimeQk, Printk^2, Printk^3, k, 5 9 6 25 In[20]:= As a For statement : Fork, k 5, k, IfPrimeQk, Printk^2, Printk^3 9 6 25 In[22]:= As a While statement : k ; Whilek 5, IfPrimeQk, Printk^2, Printk^3; k 9 6 25
6 phys30-20firsthourexams.nb EQUATIONS AND RESUTS f x = a 0 2 +S an cos nx + S bn sin nx n= n= p p a 0 = p f x dx a n = -p p f x cos nxdx b n = -p p f x sin nxdx -p f x = a 0 2 +S an cos n p x + S bn sin n p x n= n= a 0 = f x dx a n = - f x cos n p x dx - b n = f x sin n p x dx - average value of f x 2 = a 0 2 2 + 2 S 2 an + n= 2 S bn 2 n= p d ij = e ijk = 0, i j, i = j 0, any 2 indices equal, all indices different and cyclic -, all indices different and anti - cyclic e ijk e imn =d jm d kn -d jn d km Values of indefinite integrals Integratex Cosn x, x Sinn x, x Cosn x x Sinn x x Cosn x Sinn x, n 2 n n n 2 Integratex Cosn x, x Sinn x, x 2 Cos n x x Sin n x x Cos n x, n 2 2 n n Integratex^2 Cosn x, x^2 Sinn x, x 2 x Cosn x n 2 2 n 2 x 2 Sinn x n 3 2 Sin n x n 2 2 2 n 2 x 2 Cosn x, n 3 2 x Sinn x n 2
phys30-20firsthourexams.nb 7 Integratex^2 Cosn x, x^2 Sinn x, x 2 n x Cos n x 2 2 n 2 2 x 2 Sin n x, n 3 3 2 2 n 2 2 x 2 Cos n x 2n x Sin n x n 3 3 Integratex^3 Cosn x, x^3 Sinn x, x 3 2 n 2 x 2 Cosn x x 6 n 2 x 2 Sinn x x 6 n 2 x 2 Cosn x 3 2 n 2 x 2 Sinn x, n n 3 n 3 n Integratex^ Cosn x, x^ Sinn x, x x6n 2 x 2 Cosn x 2 2 n 2 x 2 n x Sinn x, n n 5 2 2 n 2 x 2 n x Cosn x n 5 From the Mathematica Doc Center x6n 2 x 2 Sinn x n Doexpr, i max evaluates expr i max times. Doexpr, i, i max evaluates expr with the variable i successively taking on the values through i max (in steps of ). Doexpr, i, i min, i max starts with i i min. Doexpr, i, i min, i max, di uses steps di. Doexpr, i, i, i 2, uses the successive values i, i 2,. Doexpr, i, i min, i max, j, j min, j max, evaluates expr looping over different values of j, etc. for each i. Ifcondition, t, f gives t if condition evaluates to True, and f if it evaluates to False. Ifcondition, t, f, u gives u if condition evaluates to neither True nor False. PrimeQexpr yields True if expr is a prime number, and yields False otherwise.
8 phys30-20firsthourexams.nb Forstart, test, incr, body executes start, then repeatedly evaluates body and incr until test fails to give True. Whiletest, body evaluates test, then body, repetitively, until test first fails to give True.