Simply put. You need to eat more.
Try going to fitday.com and calculating how many calories you eat
during a given day vs. how many calories you burn during a given day.
You will notice that during your triathlon training you will be
burning a lot more than you take in. If all the food you take in is
being used for energy due to your training then there is no extra food
available to be turned into muscle or fat (preferably muscle,
The amount that you normally burn during a day is called "maintenance"
calories and at that point you will neither gain nor lose weight. A
normal person's maintenance calorie level is usually in the low
thousands but I would venture to guess that yours may be more toward
the mid-to-high thousands due to your training.
On another note you should know that any long cardio activity is going
to cause a reduction in muscle. Some of the energy being used for
your training is going to come from the body taking your muscle and
actually burning it as energy.
Yes you can gain weight while doing triathlon training although,
depending on yout training, you may have to eat a LOT more food than
BTW here are some numbers you will want to remember: 1 lb of fat =~
3500 calories and 1 lb of muscle is somewhere between 2,000-2,500
calories. So if you ate 500 calories less than maintenance then you
would lose a lb of bodyweight in 5-7 days although what kind of weight
you lose (ie muscle or fat) will depend much on your training. If you
do some weight training then you should be able to put on muscle,
assuming you are in caloric excess (meaning above maintenance level).
So bottom line is eat a lot of food. For more on gaining muscle check