The statement of l'Hopital's rule found in Rudin's Principles of Mathematical Analysis (page 109) is:
$5.13$ $\,\,$ Theorem $\,\,\,\,\,\,\,$ Suppose $f$ and $g$ are real and differentiable in $(a,b)$, and $g'(x)\neq 0$ for all $x\in (a,b)$, where $-\infty\leq a < b\leq +\infty$. Suppose
$$
\frac{f'(x)}{g'(x)}\to A\,\textrm{ as }\,x\to a.
$$
If
$f(x)\to 0$ and $g(x)\to 0$ as $x\to a$, or if $g(x)\to +\infty$ as $x\to a$, then
$$
\frac{f(x)}{g(x)}\to A\,\textrm{ as }\,x\to a.
$$
The analogous statement is of course also true if $x\to b$, or if $g(x)\to-\infty$ [...]. Let us note that we now use the limit concept in the extended sense of Definition $4.33$.
It seems that what $A$ is supposed to be is a little ambiguous. Real? Possibly infinite? However, we can resolve this enigma with a quick look at definition $4.33$:
$4.33$ $\,\,$ Definition $\,\,\,\,\,\,\,$ Let $f$ be a real function defined on $E\subset \Bbb{R}$. We say that
$$
f(t)\to A\,\textrm{ as }\,t\to x,
$$
where $A$ and $x$ are in the extended real number system, if for every neighborhood $U$ of $A$ there is a neighborhood $V$ of $x$ such that $V\cap E$ is not empty, and such that $f(t)\in U$ for all $t\in V\cap E$, $t\neq x$.
So indeed, $A$ is allowed to be infinite (it's in the extended real number system)! We also see that Rudin treats the cases of $A = \pm\infty$ in the proof of l'Hopital's rule, so if the limit of the quotient of derivatives is infinite, the original limit must have been also. That is, there is no example (let alone a simple one) where the limit of the quotient of derivatives is infinite, but the original limit is finite.
That's a good thing L'Hospital's rule has been banned. If it is not well applied, it can lead to errors, and when it works, using Taylor's formula at order $1$ is logically equivalent. Very often, using equivalents is the shortest way to compute a limit.
That said, use substitution: set $x=\dfrac\pi2-h$; $h\to 0$ if $x\to\dfrac\pi2$. Then
$$\frac{b(1-\sin x)}{(\pi-2x)^2}=\frac{b(1-\cos h)}{4h^2}$$
Now it is a standard limit that
$$\lim_{h\to 0}\frac{1-\cos h}{h^2}=\lim_{h\to 0}\frac{1-\cos^2 h}{h^2(1+\cos h)}=\lim_{h\to 0}\Bigl(\frac{\sin h}h\Bigr)^2\frac1{(1+\cos h)}=\frac12.$$
Thus the limit in question is equal to $\color{red}{\dfrac b8}.$
Best Answer
I would advise looking ahead in your book and just check out what l'Hôpital's rule says. This site is useful for answering a specific question, and helpful to use as a supplement to learning in class or from a book, but not really designed with teaching of a broader subject. I would also check with your instructor, as it is possible that those two questions were mistakenly included in this assignment.
That said, from Wikipedia's entry:
In its simplest form, l'Hôpital's rule states that for functions $f$ and $g$: $$\text{If }\lim_{x\to c} f(x)=\lim_{x\to c} g(x)=0 \text{ or } \pm \infty\text{ and }\lim_{x\to c} \frac {f'(x)}{g'(x)} \text{ exists,}$$ $$\text{then } \lim_{x\to c} \frac {f(x)}{g(x)}=\lim_{x\to c} \frac{f'(x)}{g'(x)}\ .$$
From this, you should be able to see why the application of l'Hôpital's is incorrect to apply to $\lim_{x\to \pi/2}\sin(x)/x$. What is the requirement of the rule? Does your limit satisfy that requirement?
For the second question, you can proceed as follows:
$$\lim_{x\to -\infty} x e^x = \lim_{x\to \infty} -x e^{-x} = \lim_{x\to\infty} \frac {-x}{e^x}\ ,$$
which then succumbs to l'Hôpital's rule.
Again, I would encourage you to check with your professor on these questions. If you haven't covered l'Hôpital's rule yet, my guess is that they did not mean to include them in this assignment.