\documentclass[10pt]{article}

% Useful packages for fonts and symbols
\usepackage{amsfonts,amssymb,amsmath,amsthm}

% Margins
%\setlength{\oddsidemargin}{-.3in}  % from default of 0.5in
%\setlength{\evensidemargin}{-.3in} % from default of 0.5in
%\setlength{\topmargin}{-.3in} 
%
%\setlength{\textwidth}{7in}  % measured from left margin
%\setlength{\textheight}{9 in} \setlength{\headheight}{1ex}

%Or use the geometry package. It's easier:
\usepackage[top=1in, bottom = 1in, left = 1in, right = 1in]{geometry}


% Page headers
\pagestyle{myheadings} \markboth{Full Name, Course,
Assignment N}{Full Name, Course,
Assignment N}


% Theorems and definitions

\newtheorem{definition}{Definition}
\newtheorem*{definition*}{Definition}
\newtheorem{assumption}{Assumption}
\newtheorem{proposition}{Proposition}
\newtheorem*{proposition*}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem*{lemma*}{Lemma}
\newtheorem{theorem}{Theorem}
\newtheorem*{theorem*}{Theorem}
\newtheorem{coro}{Corollary}
\newtheorem*{coro*}{Corollary}
\newtheorem{remark}{Remark}
\newtheorem*{remark*}{Remark}





% Spacing
\renewcommand{\baselinestretch}{1.5}  % slightly increases in-between-line spacing. Use 1 for single-space, and 2 for double-space


\begin{document}

\section*{A homework template} 

Look at the header of the source document to see how to adjust margins or line spacing.


\subsection*{Problem 1 (basics)}

\emph{Prove that $ \int_0^{1/2} \bigg(\sum_{k=0}^\infty x^k\bigg) dx < 1$.} 

\begin{theorem}[Optional description] The following inequality holds:
\[
 \int_0^{1/2} \bigg(\sum_{k=0}^\infty x^k\bigg) dx < 1 
\]
\end{theorem}


\begin{proof}
\begin{equation}\label{mylabel}
 \int_0^{1/2} \bigg(\sum_{k=0}^\infty x^k\bigg) dx = \int_0^{1/2} \frac{1}{1-x} dx =- \ln | 1-x|\bigg|_0^{1/2} = \ln(2)
\end{equation}
And $\ln 2 <1$ since $\ln(x)$ is a strictly increasing function, whence $\ln 2 < \ln e = 1$.
\end{proof}


\begin{remark}
You don't have to use the ``proof" environment as above. The QED symbol can be generated as follows: $\qed$
\end{remark}



Besides \textbf{Theorem}, the header defines other environments:

\begin{lemma}
  
\end{lemma}

\begin{proposition}
  
\end{proposition}

\begin{coro}
  
\end{coro}



\bigskip % some white space

We could split that equation (\ref{mylabel}) in the above proof over multiple lines using  \texttt{\textbackslash begin\{split\}  \textbackslash end\{split\}} inside the equation; start a new line with \textbackslash\textbackslash\  and align the lines with ``\&":
\[
\begin{split}
 \int_0^{1/2} \bigg(\sum_{k=0}^\infty x^k\bigg) dx = &  \int_0^{1/2} \frac{1}{1-x} dx\\
  =&- \ln | 1-x|\bigg|_0^{1/2}\\
   =& \ln(2)
 \end{split}
\]



\subsection*{Problem 2 (labels)}

In the previous problem one of the equations had an internal label.  LaTeX will always automatically assign labels in appropriate order. Here's another one:
\begin{equation}\label{my-equation}
     1+ e^{\pi i } = 0
\end{equation}
You can refer to it with the \texttt{\textbackslash ref\{\}} command as follows   (\ref{my-equation}), or via \texttt{\textbackslash eqref\{\}} like this \eqref{my-equation}. Whenever you introduce or change a label you must recompile the document at least twice in order for the reference to display properly.



\subsection*{Problem 3 (lists)}

Here's an enumerated list:

\begin{enumerate}
	\item  first

	\item  second

\end{enumerate}
And here's an itemized list:
\begin{itemize}
	\item   Previous 

	\item  Next

\end{itemize}

\subsection*{Problem 4 (systems and matrices)}

Solve the following system of equations
\[
\left\{  % \left( means the size will match the contents
\begin{array}{rcl}  % right-aligned, centered, left-aligned columns
x + 2y &=& 2\\
3x + 7y &=& 0\\
\end{array}
\right.   % dot means empty bracket
\]

\subsubsection*{Solution}

\[
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
 1 & 2 \\
 3 & 7 \\ 
\end{bmatrix}^{-1}
\begin{bmatrix}
 2  \\
 0  \\ 
\end{bmatrix} = 
\begin{bmatrix}
 7 &  -2\\
 -3 &  1\\ 
\end{bmatrix}
\begin{bmatrix}
 2  \\
 0  \\ 
\end{bmatrix} = 
\begin{bmatrix}
  14  \\
  -6  \\ 
\end{bmatrix}
\]

Thus $x=14$ and $y=-6$.


\subsection*{Problem 5 (macros)}

In the previous problem we had to type the vector $[2,0]$ more than once and that took quite a few symbols in the source.  Instead we could define a macro called \texttt{\textbackslash myv} (for ``my vector") and invoke it whenever we want the vector to appear

\newcommand{\myv}{
\begin{bmatrix}
2 \\ 
0 
\end{bmatrix}
}

\[
\mathbf{v} = \myv
\]

\[
\myv  + \myv + \myv +  \myv + \myv + \myv +  \myv
=\begin{bmatrix}
14 \\ 0
\end{bmatrix}
\]

When defining new macros  make sure  not borrow a name from an already existing command or macro (then instead of ``newcommand" you'll need ``renewcommand").



\end{document}
