Answer
(a) $T = (m_1+m_2)~g~\mu$
(b) $T = (m_1+m_2)~g~\mu~cos~\theta$
Work Step by Step
(a) We can find the maximum acceleration that the force of friction $F_f$ can provide for the block $m_2$:
$F_f = m_2~a$
$m_2~g~\mu = m_2~a$
$a = g~\mu$
We can find the tension which provides this acceleration to the system of both blocks:
$T = (m_1+m_2)~g~\mu$
(b) We can find the maximum acceleration that the force of friction $F_f$ can provide for the block $m_2$:
$\sum F = m_2~a$
$F_f - m_2~g~sin~\theta = m_2~a$
$m_2~g~cos~\theta~\mu - m_2~g~sin~\theta = m_2~a$
$g~cos~\theta~\mu - g~sin~\theta = a$
$a = g~(\mu~cos~\theta-sin~\theta)$
We can find the tension which provides this acceleration to the system of both blocks:
$\sum F = (m_1+m_2)~a$
$T-(m_1+m_2)~g~sin~\theta = (m_1+m_2)~g~(\mu~cos~\theta-sin~\theta)$
$T = (m_1+m_2)~g~(\mu~cos~\theta-sin~\theta+ sin~\theta)$
$T = (m_1+m_2)~g~\mu~cos~\theta$