212HomeWork1sol

# 212HomeWork1sol - Physics 212A Homework#1 Name 1 Practice...

• Notes
• 21

This preview shows pages 1–6. Sign up to view the full content.

Physics 212A Homework #1 Name: 1. Practice in transcribing expressions into Mathematica syntax a) Find the determinant of this matrix: ( use Insert, Table/Matrix ) Type it in using Insert Table as per suggestion In[14]:= mat1 = 1 2 3 4 1 - 1 0 1 - 1 2 6 7 0 2 4 1 Out[14]= 88 1, 2, 3, 4 < , 8 1, - 1, 0, 1 < , 8 - 1, 2, 6, 7 < , 8 0, 2, 4, 1 << then compute Det In[15]:= Det @ mat1 D Out[15]= 57 First, try to compute y In[16]:= y = Integrate @ Sin @ Sqrt @ t^3 + 1 DD , 8 t, 0, Sqrt @ x D<D Out[16]= 0 x Sin B 1 + t 3 F t It can' t do it. But it can correctly calculate the derivative

This preview has intentionally blurred sections. Sign up to view the full version.

In[17]:= D @ y, x D Out[17]= Sin B 1 + x 3 2 F 2 x c) Find the first 3 terms in the Taylor's series expansion of about x=0. In[18]:= Series @ Sqrt @ a + Log @ x + 1 DD , 8 x, 0, 3 <D Out[18]= a + x 2 a + H - 1 - 2a L x 2 8a 3 2 + I 3 + 6a + 8a 2 M x 3 48a 5 2 + O @ x D 4 d) Let A= 1 2 5 - 2 4 1 0 - 1 3 and B= 1 1 1 - 2 6 0 4 2 7 . Compute the comutator AB-BA and verify that H AB L T = B T A T and that H A B L - 1 = B - 1 A - 1 Type the matrices in the old fashioed way : In[19]:= A = 88 1, 2, 5 < , 8 - 2, 4, 1 < , 8 0, - 1, 3 << Out[19]= 88 1, 2, 5 < , 8 - 2, 4, 1 < , 8 0, - 1, 3 << In[20]:= B = 88 1, 1, 1 < , 8 - 2, 6, 0 < , 8 4, 2, 7 << Out[20]= 88 1, 1, 1 < , 8 - 2, 6, 0 < , 8 4, 2, 7 << Use MatrixForm to make sure we got it right : In[23]:= MatrixForm @ A D Out[23]//MatrixForm= 1 2 5 - 2 4 1 0 - 1 3 In[24]:= MatrixForm @ B D Out[24]//MatrixForm= 1 1 1 - 2 6 0 4 2 7 Commutator = In[25]:= A.B - B.A Out[25]= 88 18, 18, 27 < , 8 8, 4, 9 < , 8 14, - 9, - 22 << 2 212HomeWork1sol.nb
In[26]:= MatrixForm @ % D Out[26]//MatrixForm= 18 18 27 8 4 9 14 - 9 - 22 H AB L T = B T A T : In[27]:= TrAB = Transpose @ A.B D Out[27]= 88 17, - 6, 14 < , 8 23, 24, 0 < , 8 36, 5, 21 << In[28]:= TrBTrA = Transpose @ B D .Transpose @ A D Out[28]= 88 17, - 6, 14 < , 8 23, 24, 0 < , 8 36, 5, 21 << In[29]:= TrAB - TrBTrA Out[29]= 88 0, 0, 0 < , 8 0, 0, 0 < , 8 0, 0, 0 << In[30]:= TrAB TrBTrA Out[30]= True H A B L - 1 = B - 1 A - 1 : In[31]:= Inverse @ A.B D - Inverse @ B D .Inverse @ A D Out[31]= 88 0, 0, 0 < , 8 0, 0, 0 < , 8 0, 0, 0 << 212HomeWork1sol.nb 3

This preview has intentionally blurred sections. Sign up to view the full version.

In[32]:= Inverse @ A.B D == Inverse @ B D .Inverse @ A D Out[32]= True Use Mathematica to evaluate e) x Tan @ k x D 2 x In[33]:= Integrate @ xTan @ kx D ^2, x D Out[33]= - x 2 2 + Log @ Cos @ kx DD k 2 + xTan @ kx D k f) 0 ¥ e - s x x 3 Cos @ k x D x for positive s and real k. In[34]:= Integrate A ª - sx x 3 Cos @ kx D , 8 x, 0, ¥ < , Assumptions fi 8 s > 0, k ˛ Reals <E Out[34]= 6 I k 4 - 6k 2 s 2 + s 4 M I k 2 + s 2 M 4 g) 0 ¥ J 0 @ k r D 1 + k 2 r 2 r for positive values of k (look up BesselJ ) In[35]:= Integrate B BesselJ @ 0, kr D 1 + k 2 r 2 , 8 r, 0, ¥ < , Assumptions fi k > 0 F Out[35]= BesselI A 0, 1 2 E BesselK A 0, 1 2 E k 2. Practice using DSolve. The differential equation d n d t = Α n - Β n 2 , is a model for population dynamics. The number of individuals n is a function of t, while Α and Β are constants. a) Find the general solution to this differential equation. In[37]:= n1 = n @ t D . DSolve @ n' @ t D Α * n @ t D - Β * n @ t D ^2, n @ t D , t D Out[37]= : ª t Α Α Α C @ 1 D + ª t Α Β > If the curly brackets are irritating, get rid of themwith either First of Flatten In[38]:= n1 = n @ t D . First @ DSolve @ n' @ t D Α * n @ t D - Β * n @ t D ^2, n @ t D , t DD Out[38]= ª t Α Α Α C @ 1 D + ª t Α Β 4 212HomeWork1sol.nb
In[39]:= n1 = n @ t D . Flatten @ DSolve @ n' @ t D Α * n @ t D - Β * n @ t D ^2, n @ t D , t DD Out[39]= ª t Α Α Α C @ 1 D + ª t Α Β b)The population approaches a constant as t fi¥ . What is the constant asymptotic population? Use Limit and Assumptions.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern