BCS theory for trapped ultracold fermions